You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/09/23 06:13:16 UTC
[GitHub] [pulsar] congbobo184 opened a new pull request #8111: Owner ship current server not destined
congbobo184 opened a new pull request #8111:
URL: https://github.com/apache/pulsar/pull/8111
this PR also solve #8071 , we don't add the incorrect bundle data int the server own cache
### Motivation
modify the get ownership logic to support getOwnerAsync twice can get the same result.
### Modifications
```
org.apache.pulsar.broker.namespace.OwnershipCache;
private CompletableFuture<Optional<Map.Entry<NamespaceEphemeralData, Stat>>> resolveOwnership(String path) {
return ownershipReadOnlyCache.getWithStatAsync(path).thenApply(optionalOwnerDataWithStat -> {
if (optionalOwnerDataWithStat.isPresent()) {
Map.Entry<NamespaceEphemeralData, Stat> ownerDataWithStat = optionalOwnerDataWithStat.get();
Stat stat = ownerDataWithStat.getValue();
if (stat.getEphemeralOwner() == localZkCache.getZooKeeper().getSessionId()) {
LOG.info("Successfully reestablish ownership of {}", path);
OwnedBundle ownedBundle = new OwnedBundle(ServiceUnitZkUtils.suBundleFromPath(path, bundleFactory));
if (selfOwnerInfo.getNativeUrl().equals(ownerDataWithStat.getKey().getNativeUrl())) {
ownedBundlesCache.put(path, CompletableFuture.completedFuture(ownedBundle));
}
ownershipReadOnlyCache.invalidate(path);
namespaceService.onNamespaceBundleOwned(ownedBundle.getNamespaceBundle());
}
}
return optionalOwnerDataWithStat;
});
}
```
### Verifying this change
add the test for it.
### Does this pull request potentially affect one of the following parts:
*If `yes` was chosen, please highlight the changes*
- Dependencies (does it add or upgrade a dependency): (no)
- The public API: (no)
- The schema: (no)
- The default values of configurations: (no)
- The wire protocol: (no)
- The rest endpoints: (no)
- The admin cli options: (no)
- Anything that affects deployment: (no)
### Documentation
- Does this pull request introduce a new feature? (no)
- If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
- If a feature is not applicable for documentation, explain why?
- If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui merged pull request #8111: [Fix] Should not cache the owner that does not belong to current server
Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #8111:
URL: https://github.com/apache/pulsar/pull/8111
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui merged pull request #8111: [Fix] Should not cache the owner that does not belong to current server
Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #8111:
URL: https://github.com/apache/pulsar/pull/8111
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] congbobo184 commented on pull request #8111: [Fix] Should not cache the owner that does not belong to current server
Posted by GitBox <gi...@apache.org>.
congbobo184 commented on pull request #8111:
URL: https://github.com/apache/pulsar/pull/8111#issuecomment-698140047
/pulsarbot run-failure-checks
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] congbobo184 commented on pull request #8111: [Fix] Should not cache the owner that does not belong to current server
Posted by GitBox <gi...@apache.org>.
congbobo184 commented on pull request #8111:
URL: https://github.com/apache/pulsar/pull/8111#issuecomment-698127369
/pulsarbot run-failure-checks
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] congbobo184 commented on pull request #8111: [Fix] Should not cache the owner that does not belong to current server
Posted by GitBox <gi...@apache.org>.
congbobo184 commented on pull request #8111:
URL: https://github.com/apache/pulsar/pull/8111#issuecomment-698127369
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] congbobo184 commented on pull request #8111: [Fix] Should not cache the owner that does not belong to current server
Posted by GitBox <gi...@apache.org>.
congbobo184 commented on pull request #8111:
URL: https://github.com/apache/pulsar/pull/8111#issuecomment-697226283
/pulsarbot run-failure-checks
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] congbobo184 commented on pull request #8111: [Fix] Should not cache the owner that does not belong to current server
Posted by GitBox <gi...@apache.org>.
congbobo184 commented on pull request #8111:
URL: https://github.com/apache/pulsar/pull/8111#issuecomment-697255331
/pulsarbot run-failure-checks
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org