gaozhangmin opened a new issue, #3759: URL: https://github.com/apache/bookkeeper/issues/3759
**BUG REPORT** ***Describe the bug*** #3239 addressed the replication problem of empty ledger, which means the first entry id is `INVALID_ENTRY_ID`. The replicationWorker would tried to replicate these empty ledgers, LINE 441 opened these empty ledgers with `openLedgerNoRecovery`. In method `openLedgerNoRecovery`, ` readLastConfirmed` request will be send to server. https://github.com/apache/bookkeeper/blob/c7cc668230b7a2d5f114f37709d01a1449caea12/bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java#L432-L481 Let us check how the server processes the readLastConfirmed request. LINE 547 tries to getLastEntry if the request entry id is `LAST_ADD_CONFIRMED ` https://github.com/apache/bookkeeper/blob/c7cc668230b7a2d5f114f37709d01a1449caea12/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java#L542-L549 Finally, it goes to here. Try to get the last entry id from RocksDB, For a non-existed entry, it searched the a range of ledgers from current ledger id to `Long.MAX_VALUE`. This search will run for 5mins in my prod env. This caused the slowly process of read request and filled up the read request queue finally.  https://github.com/apache/bookkeeper/blob/c7cc668230b7a2d5f114f37709d01a1449caea12/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/EntryLocationIndex.java#L116-L138 -- 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]
