keith-turner commented on code in PR #2792:
URL: https://github.com/apache/accumulo/pull/2792#discussion_r972434828


##########
server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectionAlgorithm.java:
##########
@@ -216,6 +225,46 @@ private long 
removeBlipCandidates(GarbageCollectionEnvironment gce,
     return blipCount;
   }
 
+  @VisibleForTesting
+  /**
+   * Double check no tables were missed during GC
+   */
+  protected void ensureAllTablesChecked(Set<TableId> tableIdsBefore, 
Set<TableId> tableIdsSeen,
+      Set<TableId> tableIdsAfter) {

Review Comment:
   Elsewhere there was a comment about using table states.  If we had tables 
states from ZK, then something like the following would avoid race conditions.
   
   ```suggestion
     protected void ensureAllTablesChecked(Map<TableId,TableState> 
tableIdsAndStatesBefore, Set<TableId> tableIdsSeen,
         Map<TableId,TableState> tableIdsAndStatesAfter) {
         
         //TODO maybe copy maps before deleting from them
         //only consider table ids with states ONLINE and OFFLINE because 
entries must exist in the metadata table when a table is in these states.  Look 
at how table states are set relative to metadata updates in table creation and 
deletion for more details.
         tableIdsAndStatesBefore.values().removeIf(tabState - > tabState != 
ONLINE && tabState != OFFLINE);
         tableIdsAndStatesAfter.values().removeIf(tabState - > tabState != 
ONLINE && tabState != OFFLINE);
         
         var tableIdsBefore = tableIdsAndStatesBefore.keySet();
         var tableIdsAfter = tableIdsAndStatesAfter.keySet();
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to