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/05/21 03:59:57 UTC

[38/50] [abbrv] git commit: ACCUMULO-378 We can only mark these logs as closed when there weren't any mutations replayed.

ACCUMULO-378 We can only mark these logs as closed when there weren't any mutations replayed.

If there were any mutations that were replayed from the logSet, we end up reusing the
logs which means that we may prematurely remove wals


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/a4b46d96
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/a4b46d96
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/a4b46d96

Branch: refs/heads/ACCUMULO-378
Commit: a4b46d96c0c2137117817c0183c40b4450ca2148
Parents: 8df4f41
Author: Josh Elser <el...@apache.org>
Authored: Mon May 19 19:20:41 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Mon May 19 19:20:41 2014 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/tserver/Tablet.java     | 27 +++++++++++++-------
 1 file changed, 18 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/a4b46d96/server/tserver/src/main/java/org/apache/accumulo/tserver/Tablet.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/Tablet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/Tablet.java
index efcd6c2..855d9ef 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/Tablet.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/Tablet.java
@@ -1403,18 +1403,27 @@ public class Tablet {
         }
         commitSession.updateMaxCommittedTime(tabletTime.getTime());
 
-        // Ensure that we write a record marking each WAL as requiring replication to make sure we don't abandon the data
-        if (ReplicationConfigurationUtil.isEnabled(extent, tabletServer.getTableConfiguration(extent))) {
-          Status status = StatusUtil.fileClosed(System.currentTimeMillis());
-          for (LogEntry logEntry : logEntries) {
-            log.debug("Writing closed status to metadata table for " + logEntry.logSet + " " + ProtobufUtil.toString(status));
-            ReplicationTableUtil.updateFiles(SystemCredentials.get(), extent, logEntry.logSet, status);
-          }
-        }
-
         if (count[0] == 0) {
           MetadataTableUtil.removeUnusedWALEntries(extent, logEntries, tabletServer.getLock());
+
+          // Ensure that we write a record marking each WAL as requiring replication to make sure we don't abandon the data
+          if (ReplicationConfigurationUtil.isEnabled(extent, tabletServer.getTableConfiguration(extent))) {
+            Status status = StatusUtil.fileClosed(System.currentTimeMillis());
+            for (LogEntry logEntry : logEntries) {
+              log.debug("Writing closed status to metadata table for " + logEntry.logSet + " " + ProtobufUtil.toString(status));
+              ReplicationTableUtil.updateFiles(SystemCredentials.get(), extent, logEntry.logSet, status);
+            }
+          }
+
           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,
+          // but that they may get more data
+          Status status = StatusUtil.openWithUnknownLength();
+          for (LogEntry logEntry : logEntries) {
+            log.debug("Writing updated status to metadata table for " + logEntry.logSet + " " + ProtobufUtil.toString(status));
+            ReplicationTableUtil.updateFiles(SystemCredentials.get(), extent, logEntry.logSet, status);
+          }
         }
 
       } catch (Throwable t) {