bookkeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From si...@apache.org
Subject bookkeeper git commit: BOOKKEEPER-695: Some entry logs are not removed from the bookie storage (Matteo Merli via sijie)
Date Tue, 21 Apr 2015 07:45:04 GMT
Repository: bookkeeper
Updated Branches:
  refs/heads/master 70da24d50 -> b6dd50534


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/b6dd5053
Tree: http://git-wip-us.apache.org/repos/asf/bookkeeper/tree/b6dd5053
Diff: http://git-wip-us.apache.org/repos/asf/bookkeeper/diff/b6dd5053

Branch: refs/heads/master
Commit: b6dd505342051f267ca6af5fba1b70637c1e3fe0
Parents: 70da24d
Author: Sijie Guo <sijie@apache.org>
Authored: Tue Apr 21 00:44:52 2015 -0700
Committer: Sijie Guo <sijie@apache.org>
Committed: Tue Apr 21 00:44:52 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/b6dd5053/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index c9842d1..e55b2d6 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -79,6 +79,10 @@ Trunk (unreleased changes)
 
         BOOKKEEPER-848: Use volatile for lastAddConfirmed (Matteo Merli via sijie)
 
+      bookkeeper-server:
+
+        BOOKKEEPER-695: Some entry logs are not removed from the bookie storage (Matteo Merli
via sijie)
+
 Release 4.3.0 - 2014-10-03
 
   Non-backward compatible changes:

http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/b6dd5053/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 0e052b5..725d5bf 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
@@ -782,20 +782,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();
@@ -810,8 +809,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/b6dd5053/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