You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2014/10/23 20:58:24 UTC
[7/9] git commit: ACCUMULO-3249 Extra comments about issuing updates
to replication status for WALs.
ACCUMULO-3249 Extra comments about issuing updates to replication status for WALs.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/6a713aa4
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/6a713aa4
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/6a713aa4
Branch: refs/heads/master
Commit: 6a713aa4282ddfd658de7af05a801f5791cd4eec
Parents: ceb131c
Author: Josh Elser <el...@apache.org>
Authored: Wed Oct 22 14:53:19 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Thu Oct 23 11:18:59 2014 -0400
----------------------------------------------------------------------
.../apache/accumulo/tserver/tablet/DatafileManager.java | 3 ++-
.../java/org/apache/accumulo/tserver/tablet/Tablet.java | 10 +++++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6a713aa4/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
index a84f092..5cdc1af 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
@@ -422,7 +422,8 @@ class DatafileManager {
// Mark that we have data we want to replicate
// This WAL could still be in use by other Tablets *from the same table*, so we can only mark that there is data to replicate,
- // but it is *not* closed
+ // but it is *not* closed. We know it is not closed by the fact that this MinC triggered. A MinC cannot happen unless the
+ // tablet is online and thus these WALs are referenced by that tablet. Therefore, the WAL replication status cannot be 'closed'.
if (replicate) {
if (log.isDebugEnabled()) {
log.debug("Recording that data has been ingested into " + tablet.getExtent() + " using " + logFileOnly);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6a713aa4/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index 8ba72b7..d82827e 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
@@ -621,11 +621,19 @@ public class Tablet implements TabletCommitter {
log.debug("No replayed mutations applied, removing unused entries for " + extent);
MetadataTableUtil.removeUnusedWALEntries(extent, logEntries, tabletServer.getLock());
+ // No replication update to be made because the fact that this tablet didn't use any mutations
+ // from the WAL implies nothing about use of this WAL by other tablets. Do nothing.
+
logEntries.clear();
} else if (ReplicationConfigurationUtil.isEnabled(extent, tabletServer.getTableConfiguration(extent))) {
- // The logs are about to be re-used, we need to record that they have data for this extent,
+ // The logs are about to be re-used by this tablet, we need to record that they have data for this extent,
// but that they may get more data. logEntries is not cleared which will cause the elements
// in logEntries to be added to the currentLogs for this Tablet below.
+ //
+ // This update serves the same purpose as an update during a MinC. We know that the WAL was defined
+ // (written when the WAL was opened) but this lets us know there are mutations written to this WAL
+ // that could potentially be replicated. Because the Tablet is using this WAL, we can be sure that
+ // the WAL isn't closed (WRT replication Status) and thus we're safe to update its progress.
Status status = StatusUtil.openWithUnknownLength();
for (LogEntry logEntry : logEntries) {
log.debug("Writing updated status to metadata table for " + logEntry.logSet + " " + ProtobufUtil.toString(status));