You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/01/03 22:26:43 UTC

[GitHub] [accumulo] keith-turner commented on a change in pull request #2397: Add consistency checks for lastFlushID and lastCompactID

keith-turner commented on a change in pull request #2397:
URL: https://github.com/apache/accumulo/pull/2397#discussion_r777733833



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
##########
@@ -1412,12 +1412,40 @@ private void closeConsistencyCheck() {
 
     if (!otherLogs.isEmpty() || !currentLogs.isEmpty() || !referencedLogs.isEmpty()) {
       String msg = "Closed tablet " + extent + " has walog entries in memory currentLogs = "
-          + currentLogs + "  otherLogs = " + otherLogs + " refererncedLogs = " + referencedLogs;
+          + currentLogs + "  otherLogs = " + otherLogs + " referencedLogs = " + referencedLogs;
       log.error(msg);
       throw new RuntimeException(msg);
     }
 
-    // TODO check lastFlushID and lostCompactID - ACCUMULO-1290
+    // If a table hasn't been flushed before it was closed then lastFlushID will be -1 while
+    // getFlushID will be 0.
+    try {
+      long flushID = getFlushID();

Review comment:
       this will read the current table wide flush ID from ZK.  That is not what we want to check here.  Instead, we want to check if lastFlushId matches what is stored in the metdata table for this tablet.  The lastFlushId instance var should contain whats in the metadata table and it should be updated in memory when the metadata table is updated.  We can change the Ample code that reads the tablet metadata to include flush id and then do something like the following.
   
   ```java
   if(tabletMeta.getFlushId().orElse(-1) != lastFlushId) {
     // mismatch with tablet metadata , so throw exception
   }
   ```
   
   Not sure if the case where flushId was never set it correct in the code above.  Need to investigate further.
   
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org