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-826: PendingAddOp is ignoring ack response after meet ack quorum constraint (sijie)
Date Tue, 06 Oct 2015 09:12:29 GMT
Repository: bookkeeper
Updated Branches:
  refs/heads/master 48ab23ef3 -> 885cebf11


BOOKKEEPER-826: PendingAddOp is ignoring ack response after meet ack quorum constraint (sijie)


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

Branch: refs/heads/master
Commit: 885cebf113ea104dc579f93d6e112825a3bf1959
Parents: 48ab23e
Author: Sijie Guo <sijie@apache.org>
Authored: Tue Oct 6 02:12:15 2015 -0700
Committer: Sijie Guo <sijie@apache.org>
Committed: Tue Oct 6 02:12:15 2015 -0700

----------------------------------------------------------------------
 CHANGES.txt                                             |  2 ++
 .../java/org/apache/bookkeeper/client/LedgerHandle.java | 12 ++++++++++++
 2 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/885cebf1/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d626197..504934b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -42,6 +42,8 @@ Trunk (unreleased changes)
 
       BOOKKEEPER-821: Failing to write lastId to ledger directories should not fail startup
of bookies (zhaijia via sijie)
 
+      BOOKKEEPER-826: PendingAddOp is ignoring ack response after meet ack quorum constraint
(sijie)
+
     IMPROVEMENTS:
 
       BOOKKEEPER-800: Expose whether a ledger is closed or not (ivank)

http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/885cebf1/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
----------------------------------------------------------------------
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
index 4ed3c03..36faac4 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java
@@ -880,6 +880,12 @@ public class LedgerHandle {
     }
 
     void handleBookieFailure(final BookieSocketAddress addr, final int bookieIndex) {
+        // If this is the first failure,
+        // try to submit completed pendingAddOps before this failure. 
+        if (0 == blockAddCompletions.get()) {
+            sendAddSuccessCallbacks(); 
+        }
+
         blockAddCompletions.incrementAndGet();
 
         synchronized (metadata) {
@@ -888,6 +894,12 @@ public class LedgerHandle {
                 LOG.warn("Write did not succeed to {}, bookieIndex {}, but we have already
fixed it.",
                          addr, bookieIndex);
                 blockAddCompletions.decrementAndGet();
+
+                // Try to submit completed pendingAddOps, pending by this fix. 
+                if (0 == blockAddCompletions.get()) {
+                    sendAddSuccessCallbacks(); 
+                }
+
                 return;
             }
 


Mime
View raw message