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 (apache#12650)

Co-authored-by: Jiang Haiting <jianghaiting@didichuxing.com>
(cherry picked from commit 52764ce)
  • Loading branch information
Jason918 authored and lhotari committed Dec 3, 2021
1 parent 8fe8c3f commit 6536bbc
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 6536bbc

Please sign in to comment.