Skip to content

Commit

Permalink
revert the wrong modification in org.apache.pulsar.broker.namespace.O…
Browse files Browse the repository at this point in the history
…wnershipCache#checkOwnership (#12650)

Co-authored-by: Jiang Haiting <[email protected]>
  • Loading branch information
Jason918 and Jiang Haiting authored Nov 6, 2021
1 parent 916cb3b commit 52764ce
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,13 @@ public CompletableFuture<Boolean> checkOwnership(NamespaceBundle bundle) {
return CompletableFuture.completedFuture(true);
}
String bundlePath = ServiceUnitUtils.path(bundle);
return resolveOwnership(bundlePath).thenApply(Optional::isPresent);
return resolveOwnership(bundlePath).thenApply(optionalOwnedDataWithStat -> {
if (!optionalOwnedDataWithStat.isPresent()) {
return false;
}
Stat stat = optionalOwnedDataWithStat.get().getValue();
return stat.getEphemeralOwner() == localZkCache.getZooKeeper().getSessionId();
});
}

/**
Expand Down

0 comments on commit 52764ce

Please sign in to comment.