bookkeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mme...@apache.org
Subject bookkeeper git commit: BOOKKEEPER-695: Some entry logs are not removed from the bookie storage (Matteo Merli via sijie)
Date Fri, 25 Sep 2015 06:03:59 GMT
Repository: bookkeeper
Updated Branches:
  refs/heads/branch-4.3 0a698ca9b -> 6b5e59885


BOOKKEEPER-695: Some entry logs are not removed from the bookie storage (Matteo Merli via
sijie)


Project: http://git-wip-us.apache.org/repos/asf/bookkeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/bookkeeper/commit/6b5e5988
Tree: http://git-wip-us.apache.org/repos/asf/bookkeeper/tree/6b5e5988
Diff: http://git-wip-us.apache.org/repos/asf/bookkeeper/diff/6b5e5988

Branch: refs/heads/branch-4.3
Commit: 6b5e598850e6d582be1d47980f3988f417a34614
Parents: 0a698ca
Author: Matteo Merli <mmerli@apache.org>
Authored: Tue Apr 21 00:44:52 2015 -0700
Committer: Matteo Merli <mmerli@apache.org>
Committed: Thu Sep 24 23:01:53 2015 -0700

----------------------------------------------------------------------
 CHANGES.txt                                         |  4 ++++
 .../org/apache/bookkeeper/bookie/EntryLogger.java   | 16 ++++++++--------
 .../org/apache/bookkeeper/bookie/EntryLogTest.java  |  6 +-----
 3 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/6b5e5988/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index c918b51..84adba7 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -3,6 +3,9 @@ Release 4.3.2 - unreleased
   Backward compatible changes:
 
     BUGFIXES:
+      bookkeeper-server:
+
+        BOOKKEEPER-695: Some entry logs are not removed from the bookie storage (Matteo Merli
via sijie)
 
     IMPROVEMENTS:
 
@@ -62,6 +65,7 @@ Release 4.3.1 - 2015-05-19
 
         BOOKKEEPER-833: EntryLogId and EntryLogLimit should not be larger than Integer.MAX_VALUE
(sijie)
 
+
 Release 4.3.0 - 2014-10-03
 
   Non-backward compatible changes:

http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/6b5e5988/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
----------------------------------------------------------------------
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
index 91ac8b4..d083f5e 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogger.java
@@ -793,20 +793,19 @@ public class EntryLogger {
                 break;
             }
             if (readFromLogChannel(entryLogId, bc, sizeBuff, pos) != sizeBuff.capacity())
{
-                throw new IOException("Short read for entry size from entrylog " + entryLogId);
+                LOG.warn("Short read for entry size from entrylog {}", entryLogId);
+                return;
             }
             long offset = pos;
             pos += 4;
             sizeBuff.flip();
             int entrySize = sizeBuff.getInt();
-            if (entrySize > MB) {
-                LOG.warn("Found large size entry of " + entrySize + " at location " + pos
+ " in "
-                        + entryLogId);
-            }
+
             sizeBuff.clear();
             // try to read ledger id first
             if (readFromLogChannel(entryLogId, bc, lidBuff, pos) != lidBuff.capacity()) {
-                throw new IOException("Short read for ledger id from entrylog " + entryLogId);
+                LOG.warn("Short read for ledger id from entrylog {}", entryLogId);
+                return;
             }
             lidBuff.flip();
             long lid = lidBuff.getLong();
@@ -821,8 +820,9 @@ public class EntryLogger {
             ByteBuffer buff = ByteBuffer.wrap(data);
             int rc = readFromLogChannel(entryLogId, bc, buff, pos);
             if (rc != data.length) {
-                throw new IOException("Short read for ledger entry from entryLog " + entryLogId
-                                    + "@" + pos + "(" + rc + "!=" + data.length + ")");
+                LOG.warn("Short read for ledger entry from entryLog {}@{} ({} != {})", new
Object[] { entryLogId, pos,
+                        rc, data.length });
+                return;
             }
             buff.flip();
             // process the entry

http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/6b5e5988/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryLogTest.java
----------------------------------------------------------------------
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryLogTest.java
b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryLogTest.java
index 488f4bf..6b0ecd8 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryLogTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryLogTest.java
@@ -89,11 +89,7 @@ public class EntryLogTest {
         EntryLogMetadata meta = new EntryLogMetadata(0L);
         ExtractionScanner scanner = new ExtractionScanner(meta);
 
-        try {
-            logger.scanEntryLog(0L, scanner);
-            fail("Should not reach here!");
-        } catch (IOException ie) {
-        }
+        logger.scanEntryLog(0L, scanner);
 
         LOG.info("Extracted Meta From Entry Log {}", meta);
         assertNotNull(meta.ledgersMap.get(1L));


Mime
View raw message