You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2024/05/06 07:33:49 UTC
(hbase) 03/03: HBASE-28567 Race condition causes MetaRegionLocationCache to never set watcher to populate meta location (#5874)
This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hbase.git
commit d20b9cd1541342e41fa423005b122d31650a492e
Author: Vincent Poon <vi...@users.noreply.github.com>
AuthorDate: Mon May 6 00:16:19 2024 -0700
HBASE-28567 Race condition causes MetaRegionLocationCache to never set watcher to populate meta location (#5874)
Signed-off-by: Duo Zhang <zh...@apache.org>
Signed-off-by: Viraj Jasani <vj...@apache.org>
(cherry picked from commit ce113dd3f4e9bd92d799fedbf684e8b0eb9b7a4b)
---
.../src/main/java/org/apache/hadoop/hbase/zookeeper/ZKWatcher.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKWatcher.java b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKWatcher.java
index 3879cb7ba91..5af7de5678c 100644
--- a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKWatcher.java
+++ b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKWatcher.java
@@ -460,6 +460,11 @@ public class ZKWatcher implements Watcher, Abortable, Closeable {
public List<String> getMetaReplicaNodesAndWatchChildren() throws KeeperException {
List<String> childrenOfBaseNode =
ZKUtil.listChildrenAndWatchForNewChildren(this, znodePaths.baseZNode);
+ // Need to throw here instead of returning an empty list if the base znode hasn't been created
+ // Caller should retry in that case, versus thinking the base znode has a watcher set
+ if (childrenOfBaseNode == null) {
+ keeperException(new KeeperException.NoNodeException(znodePaths.baseZNode));
+ }
return filterMetaReplicaNodes(childrenOfBaseNode);
}