poorbarcode commented on code in PR #22890:
URL: https://github.com/apache/pulsar/pull/22890#discussion_r1643624372
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -553,6 +547,21 @@ private void createPersistentSubscriptions() {
checkReplicatedSubscriptionControllerState();
}
+ private CompletableFuture<Void> removeOrphanReplicationCursors() {
+ List<CompletableFuture<Void>> futures = new ArrayList<>();
+ List<String> replicationClusters =
topicPolicies.getReplicationClusters().get();
+ for (ManagedCursor cursor : ledger.getCursors()) {
+ if (cursor.getName().startsWith(replicatorPrefix)) {
+ String remoteCluster =
PersistentReplicator.getRemoteCluster(cursor.getName());
+ if (!replicationClusters.contains(remoteCluster)) {
Review Comment:
> Why just judge that it is not in the topic policies and then remove it?
Should still judge whether it is not in namespace policies?
It is a `HierarchyValue`, see the following code
```java
private void updateValue() {
VALUE_UPDATER.updateAndGet(this, (preValue) -> {
if (topicValue != null) {
return topicValue;
} else if (namespaceValue != null) {
return namespaceValue;
} else {
return brokerValue;
}
});
}
```
--
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]