You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "horizonzy (via GitHub)" <gi...@apache.org> on 2023/03/08 06:45:07 UTC

[GitHub] [bookkeeper] horizonzy commented on a diff in pull request #3837: Group and flush add-responses after journal sync

horizonzy commented on code in PR #3837:
URL: https://github.com/apache/bookkeeper/pull/3837#discussion_r1129030884


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java:
##########
@@ -499,6 +502,10 @@ public void run() {
                     journalStats.getForceWriteGroupingCountStats()
                             .registerSuccessfulValue(numReqInLastForceWrite);
 
+                    if (requestProcessor != null) {

Review Comment:
   Here we trigger all channels to flush `pendingSendResponses`, shall we only pick the requestHandler which is written to the logFile to flush `pendingSendResponses`, it may reduce the unnecessary iteration in the loop.
    
   ```
       public void flushPendingResponses() {
           for (Channel c : allChannels) {
               c.pipeline().fireUserEventTriggered(BookieRequestHandler.EVENT_FLUSH_ALL_PENDING_RESPONSES);
           }
       }
   ```
   If there are 1000 channels, maybe only 2 channels need to flush `pendingSendResponses`



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