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/05/25 04:58:06 UTC

[GitHub] [accumulo] ctubbsii commented on a diff in pull request #2293: closes #1377 - first stab at checking we hit all the tables

ctubbsii commented on code in PR #2293:
URL: https://github.com/apache/accumulo/pull/2293#discussion_r881217207


##########
server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectionAlgorithm.java:
##########
@@ -217,11 +221,50 @@ private void confirmDeletes(GarbageCollectionEnvironment gce,
         throw new RuntimeException(
             "Scanner over metadata table returned unexpected column : " + entry.getKey());
     }
+    Set<String> tableIdsAfter = gce.getTableIDs();
+    ensureAllTablesChecked(Collections.unmodifiableSet(tableIdsBefore),
+        Collections.unmodifiableSet(tableIdsSeen), Collections.unmodifiableSet(tableIdsAfter));
 
     confirmDeletesFromReplication(gce.getReplicationNeededIterator(),
         candidateMap.entrySet().iterator());
   }
 
+  @VisibleForTesting
+  /**
+   *
+   */
+  protected void ensureAllTablesChecked(Set<String> tableIdsBefore, Set<String> tableIdsSeen,
+      Set<String> tableIdsAfter) {
+
+    // if a table was added or deleted during this run, it is acceptable to not
+    // have seen those tables ids when scanning the metadata table. So get the intersection
+    Set<String> tableIdsMustHaveSeen = new HashSet<>(tableIdsBefore);
+    tableIdsMustHaveSeen.retainAll(tableIdsAfter);
+
+    if (tableIdsMustHaveSeen.isEmpty() && !tableIdsSeen.isEmpty()) {

Review Comment:
   Even with separate runs, this is still not possible. There will always be the replication table seen in the metadata table, and the metadata table will always be seen in the root table. `tableIdsMustHaveSeen` will always be non-empty, unless something seriously went wrong.



-- 
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