-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Fix system topic replicate issue #14605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
codelipenghui
merged 3 commits into
apache:master
from
Technoboy-:fix-system-topic-replicator-1
Mar 10, 2022
Merged
Fix system topic replicate issue #14605
codelipenghui
merged 3 commits into
apache:master
from
Technoboy-:fix-system-topic-replicator-1
Mar 10, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
codelipenghui
approved these changes
Mar 9, 2022
315157973
approved these changes
Mar 9, 2022
Jason918
approved these changes
Mar 9, 2022
Contributor
Jason918
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
1 task
nodece
approved these changes
Mar 10, 2022
hangc0276
approved these changes
Mar 10, 2022
Contributor
hangc0276
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
codelipenghui
pushed a commit
that referenced
this pull request
Mar 12, 2022
### Motivation PIP 92 has introduced topic policies across clusters. But after #12517, if the policy is not global, it set the replicate cluster to an empty set. ``` PulsarEvent.PulsarEventBuilder builder = PulsarEvent.builder(); if (policies == null || !policies.isGlobalPolicies()) { // we don't need to replicate local policies to remote cluster, so set `replicateTo` to empty. builder.replicateTo(new HashSet<>()); } ``` It should set the `replicateTo` with the local cluster, not an empty set. Otherwise, it will cause the system event to be replicated. Details are here : https://github.com/apache/pulsar/blob/d4c2e613d305f8f785b5ef357b7cbe2ccc271043/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java#L319-L328 (cherry picked from commit e470de5)
Nicklee007
pushed a commit
to Nicklee007/pulsar
that referenced
this pull request
Apr 20, 2022
### Motivation PIP 92 has introduced topic policies across clusters. But after apache#12517, if the policy is not global, it set the replicate cluster to an empty set. ``` PulsarEvent.PulsarEventBuilder builder = PulsarEvent.builder(); if (policies == null || !policies.isGlobalPolicies()) { // we don't need to replicate local policies to remote cluster, so set `replicateTo` to empty. builder.replicateTo(new HashSet<>()); } ``` It should set the `replicateTo` with the local cluster, not an empty set. Otherwise, it will cause the system event to be replicated. Details are here : https://github.com/apache/pulsar/blob/d4c2e613d305f8f785b5ef357b7cbe2ccc271043/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java#L319-L328
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
PIP 92 has introduced topic policies across clusters. But after #12517, if the policy is not global, it set the replicate cluster to an empty set.
It should set the
replicateTowith the local cluster, not an empty set.Otherwise, it will cause the system event to be replicated. Details are here :
pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java
Lines 319 to 328 in d4c2e61
Documentation
no-need-doc