You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/11/15 10:01:44 UTC

[GitHub] [bookkeeper] hangc0276 opened a new pull request, #3646: Make RocksDB delete entries batch size configurable

hangc0276 opened a new pull request, #3646:
URL: https://github.com/apache/bookkeeper/pull/3646

   ### Motivation
   When there are a lot of ledgers to be deleted, the EntyLocationIndex in RocksDB will delete a large number of entries at one time. 
   ```
   Nov 11, 2022 @ 05:49:39.336     05:49:39.336 [db-storage-cleanup-10-1] INFO  org.apache.bookkeeper.bookie.storage.ldb.EntryLocationIndex - Deleted indexes for 0 entries from 16074 ledgers in 625.242 seconds
   Nov 11, 2022 @ 10:18:08.281     10:18:08.281 [db-storage-cleanup-10-1] INFO  org.apache.bookkeeper.bookie.storage.ldb.EntryLocationIndex - Deleted indexes for 0 entries from 13376 ledgers in 248.66 seconds
   Nov 11, 2022 @ 14:27:06.949     14:27:06.949 [db-storage-cleanup-10-1] INFO  org.apache.bookkeeper.bookie.storage.ldb.EntryLocationIndex - Deleted indexes for 0 entries from 11798 ledgers in 265.118 seconds
   Nov 11, 2022 @ 19:45:40.593     19:45:40.593 [db-storage-cleanup-10-1] INFO  org.apache.bookkeeper.bookie.storage.ldb.EntryLocationIndex - Deleted indexes for 0 entries from 15546 ledgers in 1133.236 seconds
   ```
   The RocksDB location index deletes operation will cause RocksDB busy, and impact the read latency to a few seconds.
   
   Currently, we delete RocksDB entries in batch, and the batch size is hard-coded. We can not change it.
   
   ### Changes
   Make the RocksDB delete entries in batch configurable.


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

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


[GitHub] [bookkeeper] wenbingshen commented on a diff in pull request #3646: Make RocksDB delete entries batch size configurable

Posted by GitBox <gi...@apache.org>.
wenbingshen commented on code in PR #3646:
URL: https://github.com/apache/bookkeeper/pull/3646#discussion_r1022863036


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/EntryLocationIndex.java:
##########
@@ -254,7 +254,7 @@ public void removeOffsetFromDeletedLedgers() throws IOException {
                     ++deletedEntries;
                 }
 
-                if (deletedEntriesInBatch > DELETE_ENTRIES_BATCH_SIZE) {
+                if (deletedEntriesInBatch > deleteEntriesBatchSize) {
                     batch.flush();
                     batch.clear();
                     deletedEntriesInBatch = 0;

Review Comment:
   Sorry. I made a mistake. I have see it #3283



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

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


[GitHub] [bookkeeper] wenbingshen commented on pull request #3646: Make RocksDB delete entries batch size configurable

Posted by GitBox <gi...@apache.org>.
wenbingshen commented on PR #3646:
URL: https://github.com/apache/bookkeeper/pull/3646#issuecomment-1318125759

   @hangc0276 I'm not very clear about the current bookkeeper configuration management, including whether we need to add instructions for this new config in the docs? 
   
   Personally, I think this configuration is helpful for performance. Should it be explained to users in the docs?


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

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


[GitHub] [bookkeeper] wenbingshen commented on a diff in pull request #3646: Make RocksDB delete entries batch size configurable

Posted by GitBox <gi...@apache.org>.
wenbingshen commented on code in PR #3646:
URL: https://github.com/apache/bookkeeper/pull/3646#discussion_r1022831077


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/EntryLocationIndex.java:
##########
@@ -254,7 +254,7 @@ public void removeOffsetFromDeletedLedgers() throws IOException {
                     ++deletedEntries;
                 }
 
-                if (deletedEntriesInBatch > DELETE_ENTRIES_BATCH_SIZE) {
+                if (deletedEntriesInBatch > deleteEntriesBatchSize) {
                     batch.flush();
                     batch.clear();
                     deletedEntriesInBatch = 0;

Review Comment:
   ```
   Nov 11, 2022 @ 05:49:39.336     05:49:39.336 [db-storage-cleanup-10-1] INFO  org.apache.bookkeeper.bookie.storage.ldb.EntryLocationIndex - Deleted indexes for 0 entries from 16074 ledgers in 625.242 seconds
   ```
   
   `deletedEntries=0`, does it mean that the condition of `deletedEntriesInBatch > DELETE_ENTRIES_BATCH_SIZE` has not entered yet, will adjusting the size of `DELETE_ENTRIES_BATCH_SIZE` affect this delay? It doesn't look like the read latency to a few seconds is caused by this situation.



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

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


[GitHub] [bookkeeper] hangc0276 commented on a diff in pull request #3646: Make RocksDB delete entries batch size configurable

Posted by GitBox <gi...@apache.org>.
hangc0276 commented on code in PR #3646:
URL: https://github.com/apache/bookkeeper/pull/3646#discussion_r1022835583


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/EntryLocationIndex.java:
##########
@@ -254,7 +254,7 @@ public void removeOffsetFromDeletedLedgers() throws IOException {
                     ++deletedEntries;
                 }
 
-                if (deletedEntriesInBatch > DELETE_ENTRIES_BATCH_SIZE) {
+                if (deletedEntriesInBatch > deleteEntriesBatchSize) {
                     batch.flush();
                     batch.clear();
                     deletedEntriesInBatch = 0;

Review Comment:
   `deletedEntries=0` is a bug in the log, we have fixed it in the master branch.



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

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


[GitHub] [bookkeeper] eolivelli merged pull request #3646: Make RocksDB delete entries batch size configurable

Posted by GitBox <gi...@apache.org>.
eolivelli merged PR #3646:
URL: https://github.com/apache/bookkeeper/pull/3646


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

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