eolivelli commented on code in PR #3103:
URL: https://github.com/apache/bookkeeper/pull/3103#discussion_r903428597


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/EntryLocationIndex.java:
##########
@@ -241,25 +222,27 @@ public void removeOffsetFromDeletedLedgers() throws 
IOException {
                     if (log.isDebugEnabled()) {
                         log.debug("Deleting index for ({}, {})", 
keyToDelete.getFirst(), keyToDelete.getSecond());
                     }
-                    batch.remove(keyToDelete.array);
+                    delete(batch, keyToDelete);
                     ++deletedEntriesInBatch;
                 }
 
                 if (deletedEntriesInBatch > DELETE_ENTRIES_BATCH_SIZE) {
-                    batch.flush();
-                    batch.clear();
+                    flush(batch);
                     deletedEntriesInBatch = 0;
                 }
             }
         } finally {
             try {
-                batch.flush();
-                batch.clear();
+                flush(batch);
+
+                if (deletedEntries != 0) {
+                    locationsDb.compact(firstDeletedKey, keyToDelete.array);

Review Comment:
   are you sure that you want to compact for every deleted entry ?



-- 
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: issues-unsubscr...@bookkeeper.apache.org

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

Reply via email to