congbobo184 opened a new pull request #8256:
URL: https://github.com/apache/pulsar/pull/8256
to solve #7981
## Motivation
- we need to support transaction pending-ack stat, and we need to support
bacth ack.
- the transaction with ack, we need to return response, so we do it in the
pr.
## implement
- client ack with transaction will carry only this ack bit set 1 1 1 1 1 0 1
1,the 6 point is this transaction ack bit set point.
- client will save ack with transaction request stat, and it will time out.
this PR also solve #8071 , we don't add the incorrect bundle data int the
server own cache
```
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
(optionalOwnerDataWithStat.toString().equals(selfOwnerInfo.toString())) {
ownedBundlesCache.put(path,
CompletableFuture.completedFuture(ownedBundle));
}
ownershipReadOnlyCache.invalidate(path);
namespaceService.onNamespaceBundleOwned(ownedBundle.getNamespaceBundle());
}
}
return optionalOwnerDataWithStat;
});
}
```
### Verifying this change
Add the tests 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)
----------------------------------------------------------------
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:
[email protected]