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

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


The following commit(s) were added to refs/heads/branch-4.7 by this push:
     new e5a5475  ISSUE #1563: Spammy logs on Bookie in ReadEntryProcessorV3 in 
case of tailing reader on empty ledger
e5a5475 is described below

commit e5a54752a5f2a6190acb06fbe88cd650eb32533b
Author: Enrico Olivelli <[email protected]>
AuthorDate: Mon Jul 23 11:11:18 2018 -0700

    ISSUE #1563: Spammy logs on Bookie in ReadEntryProcessorV3 in case of 
tailing reader on empty ledger
    
    Descriptions of the changes in this PR:
    ### Motivation
    
    In case of an empty ledger the bookie floods the disk with an useless 
message.
    
    ### Changes
    
    Make that line "No ledger found while reading entry" to be logged at 
'debug' level.
    
    Master issue #1563
    
    Author: Enrico Olivelli <[email protected]>
    
    Reviewers: Sijie Guo <[email protected]>
    
    This closes #1564 from eolivelli/fix/1563-logs, closes #1563 and squashes 
the following commits:
    
    f66a9b8c0 [Enrico Olivelli] only skip logging for LastAddConfirmed Entry
    83f6217a0 [Enrico Olivelli] Issue-1563 Spammy logs on Bookie in 
ReadEntryProcessorV3 in case of tailing reader on empty ledger
    
    (cherry picked from commit 573e86b6c13a106d748c01778dcaeee9d45c39c4)
    Signed-off-by: Sijie Guo <[email protected]>
---
 .../main/java/org/apache/bookkeeper/proto/ReadEntryProcessorV3.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ReadEntryProcessorV3.java
 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ReadEntryProcessorV3.java
index 3d2a1ea..3887424 100644
--- 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ReadEntryProcessorV3.java
+++ 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ReadEntryProcessorV3.java
@@ -219,8 +219,11 @@ class ReadEntryProcessorV3 extends PacketProcessorBaseV3 {
         } catch (Bookie.NoLedgerException e) {
             if (RequestUtils.isFenceRequest(readRequest)) {
                 LOG.info("No ledger found reading entry {} when fencing ledger 
{}", entryId, ledgerId);
-            } else {
+            } else if (entryId != BookieProtocol.LAST_ADD_CONFIRMED) {
                 LOG.info("No ledger found while reading entry: {} from ledger: 
{}", entryId, ledgerId);
+            } else if (LOG.isDebugEnabled()) {
+                // this is the case of a reader which is calling 
readLastAddConfirmed and the ledger is empty
+                LOG.debug("No ledger found while reading entry: {} from 
ledger: {}", entryId, ledgerId);
             }
             return buildResponse(readResponse, StatusCode.ENOLEDGER, 
startTimeSw);
         } catch (Bookie.NoEntryException e) {

Reply via email to