You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/06/22 08:13:30 UTC

[GitHub] [bookkeeper] eolivelli commented on a diff in pull request #3103: add async or sync for :entry location index's rocksdb write

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-unsubscribe@bookkeeper.apache.org

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