cshannon commented on code in PR #4404:
URL: https://github.com/apache/accumulo/pull/4404#discussion_r1535712788


##########
server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java:
##########
@@ -246,10 +250,19 @@ public static void deleteTable(TableId tableId, boolean 
insertDeletes, ServerCon
 
   public static void removeUnusedWALEntries(ServerContext context, KeyExtent 
extent,
       final Collection<LogEntry> entries, ServiceLock zooLock) {
-    TabletMutator tablet = context.getAmple().mutateTablet(extent);
-    entries.forEach(tablet::deleteWal);
-    tablet.putZooLock(context.getZooKeeperRoot(), zooLock);
-    tablet.mutate();
+    try (ConditionalTabletsMutator mutator = 
context.getAmple().conditionallyMutateTablets()) {
+      ConditionalTabletMutator mut = 
mutator.mutateTablet(extent).requireAbsentOperation()

Review Comment:
   I think you need to add a condition here to require for the conditional 
mutation. The condition you have is only set for the rejection handler. The 
rejection handler I believe is only used to check if it should succeed if it 
was reported as rejected but not check if it was successful. So I think you 
need something like the following which would require absent logs:
   
   ```java
         ConditionalTabletMutator mut = 
mutator.mutateTablet(extent).requireAbsentOperation()
           // make sure absent logs
             .requireAbsentLogs()
             .putZooLock(context.getZooKeeperRoot(), zooLock);
   ```
   
   



-- 
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-unsubscr...@accumulo.apache.org

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

Reply via email to