Skip to content

Commit

Permalink
HBASE-28567 Race condition causes MetaRegionLocationCache to never se…
Browse files Browse the repository at this point in the history
…t watcher to populate meta location (#5874)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
  • Loading branch information
vincentpoon authored May 6, 2024
1 parent 708882c commit ce113dd
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,11 @@ public List<String> getMetaReplicaNodes() throws KeeperException {
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);
}

Expand Down

0 comments on commit ce113dd

Please sign in to comment.