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/11/02 07:23:31 UTC
[bookkeeper] branch master updated: Autorecovery may hang
indefinitely when zookeeper connection blips
This is an automated email from the ASF dual-hosted git repository.
eolivelli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new c1673bf Autorecovery may hang indefinitely when zookeeper connection blips
c1673bf is described below
commit c1673bfc140b2a3c2636cfae91c26869e6cf9502
Author: karanmehta93 <k....@salesforce.com>
AuthorDate: Sun Nov 1 23:23:22 2020 -0800
Autorecovery may hang indefinitely when zookeeper connection blips
Descriptions of the changes in this PR:
### Motivation
In certain circumstances, all AR processes were running but not performing any replication. Thus ledgers remain under-replicated for periods more than the threshold defined by our monitoring system. The reason is that the latch here gets countdown only under certain condition.
### Changes
Ensure that countdown latch is released for any ZK event. Also log the zk event.
Master Issue: #2302
Reviewers: Enrico Olivelli <eo...@apache.org>, Anup Ghatage <ga...@apache.org>
This closes #2471 from karanmehta93/ar-zk-bug
---
.../apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java
index dfb1c2a..a50261a 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java
@@ -588,13 +588,8 @@ public class ZkLedgerUnderreplicationManager implements LedgerUnderreplicationMa
Watcher w = new Watcher() {
@Override
public void process(WatchedEvent e) {
- if (e.getType() == Watcher.Event.EventType.NodeChildrenChanged
- || e.getType() == Watcher.Event.EventType.NodeDeleted
- || e.getType() == Watcher.Event.EventType.NodeCreated
- || e.getState() == Watcher.Event.KeeperState.Expired
- || e.getState() == Watcher.Event.KeeperState.Disconnected) {
- changedLatch.countDown();
- }
+ LOG.info("Latch countdown due to ZK event: " + e);
+ changedLatch.countDown();
}
};
try (SubTreeCache.WatchGuard wg = subTreeCache.registerWatcherWithGuard(w)) {