You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by eo...@apache.org on 2020/07/27 07:00:28 UTC

[bookkeeper] branch branch-4.11 updated: fix fillReadAheadCache stat bug

This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch branch-4.11
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/branch-4.11 by this push:
     new cc138c9  fix fillReadAheadCache stat bug
cc138c9 is described below

commit cc138c96515fd2c05d624ab26aecb9b743b00e53
Author: kennyjiang <63...@qq.com>
AuthorDate: Mon Jul 27 14:59:51 2020 +0800

    fix fillReadAheadCache stat bug
    
    These code blocks will not be executed:
    dbLedgerStorageStats.getReadAheadBatchCountStats().registerSuccessfulValue(count);
    dbLedgerStorageStats.getReadAheadBatchSizeStats().registerSuccessfulValue(size);
    
    ### Motivation
    
    fix fillReadAheadCache stat bug
    
    ### Changes
    
    Replace return with break to exit the while loop
    
    Reviewers: Enrico Olivelli <eo...@gmail.com>, Rajan Dhabalia <rd...@apache.org>
    
    This closes #2383 from holmes07/master
    
    (cherry picked from commit 96f9c5a1b3a0b74d641a288544b6a3a0aa986574)
    Signed-off-by: Enrico Olivelli <eo...@apache.org>
---
 .../bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
index 60e3d64..931c3e0 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
@@ -475,7 +475,7 @@ public class SingleDirectoryDbLedgerStorage implements CompactableLedgerStorage
 
                     if (currentEntryLedgerId != orginalLedgerId) {
                         // Found an entry belonging to a different ledger, stopping read-ahead
-                        return;
+                        break;
                     }
 
                     // Insert entry in read cache