ctubbsii commented on a change in pull request #541: fixes #538 fix WAL 
recovery code
URL: https://github.com/apache/accumulo/pull/541#discussion_r199309718
 
 

 ##########
 File path: 
server/tserver/src/main/java/org/apache/accumulo/tserver/log/SortedLogRecovery.java
 ##########
 @@ -183,34 +183,37 @@ private long findRecoverySeq(List<Path> recoveryLogs, 
Set<String> tabletFiles, i
 
         checkState(key.seq >= 0, "Unexpected negative seq %s for tabletId %s", 
key.seq, tabletId);
         checkState(key.tabletId == tabletId); // should only fail if bug 
elsewhere
+        checkState(key.seq >= Math.max(lastFinish, lastStart)); // should only 
fail if bug elsewhere
+
+        switch (key.event) {
+          case COMPACTION_START:
+            lastStart = key.seq;
+            lastStartFile = key.filename;
+            break;
+          case COMPACTION_FINISH:
+            checkState(key.seq > lastStart, "Compaction finish <= start %s %s 
%s", key.tabletId,
+                key.seq, lastStart);
+            checkState(lastEvent != COMPACTION_FINISH,
+                "Saw consecutive COMPACTION_FINISH events %s %s %s", 
key.tabletId, lastFinish,
 
 Review comment:
   Might be useful if the parameter order in these messages were consistent. 
(tabletId, seq, then lastX); in the first message, seq is second, in the second 
message, seq is third.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to