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/02/24 03:08:08 UTC

[GitHub] [bookkeeper] shustsud edited a comment on issue #3070: checkAllLedgers gets stuck when read throttling is enabled.

shustsud edited a comment on issue #3070:
URL: https://github.com/apache/bookkeeper/issues/3070#issuecomment-1049446938


   @lordcheng10 
   
   readEntryComplete(callback) is run in the BookKeeperClientWorker-OrderedExecutor thread.
   ```
   https://github.com/apache/bookkeeper/blob/525a4a03f99afe1dca120477273537a6db46873c/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerChecker.java#L314
   ```
   
   Then, BookKeeperClientWorker-OrderedExecutor thread acquires the lock of semaphore.
   ```
   https://github.com/apache/bookkeeper/blob/525a4a03f99afe1dca120477273537a6db46873c/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerChecker.java#L323
    -> https://github.com/apache/bookkeeper/blob/525a4a03f99afe1dca120477273537a6db46873c/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerChecker.java#L430-L431
     -> https://github.com/apache/bookkeeper/blob/525a4a03f99afe1dca120477273537a6db46873c/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerChecker.java#L469
      -> https://github.com/apache/bookkeeper/blob/525a4a03f99afe1dca120477273537a6db46873c/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerChecker.java#L208
       -> https://github.com/apache/bookkeeper/blob/525a4a03f99afe1dca120477273537a6db46873c/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerChecker.java#L246
       or
       -> https://github.com/apache/bookkeeper/blob/525a4a03f99afe1dca120477273537a6db46873c/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerChecker.java#L291
   ```
   
   If all BookKeeperClientWorker-OrderedExecutor threads are waiting to acquire the lock, there are no available BookKeeperClientWorker-OrderedExecutor threads, so readEntryComplete(callback) will not be run.
   If readEntryComplete(callback) is not run, the lock on semaphore is not released, so I think checkAllLedgers gets stuck.
   ```
   https://github.com/apache/bookkeeper/blob/525a4a03f99afe1dca120477273537a6db46873c/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerChecker.java#L80-L82
   https://github.com/apache/bookkeeper/blob/525a4a03f99afe1dca120477273537a6db46873c/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerChecker.java#L314-L316
   ```
   
   If you set a low value for read throttle(inFlightReadEntryNumInLedgerChecker) and also a low value for the number of threads in BookKeeperClientWorker-OrderedExecutor(numWorkerThreads?), I think this problem will be reproduced.
   


-- 
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