horizonzy commented on code in PR #17192:
URL: https://github.com/apache/pulsar/pull/17192#discussion_r950985311
##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/PulsarLedgerIdGenerator.java:
##########
@@ -287,4 +288,16 @@ private static String createLedgerPrefix(String
ledgersPath, String idGenZnodeNa
return ledgerIdGenPath + "/" + "ID-";
}
+ //If the config rootPath when use zk metadata store, it will append
rootPath as the prefix of the path.
+ //So when we get the path from the stat, we should truncate the rootPath.
+ private String handleTheDeletePath(String path) {
+ if (store instanceof ZKMetadataStore) {
+ String rootPath = ((ZKMetadataStore) store).getRootPath();
Review Comment:
> I see we already have ledgersRoot of PulsarLedgerIdGenerator constructor,
it's better to use it directly to avoid such checks here.
It's not the zk rootPath, the `ledgersRoot` is `/ledegrs`.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]