-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix] [broker] Messages lost on the remote cluster when using topic level replication #22890
[fix] [broker] Messages lost on the remote cluster when using topic level replication #22890
Conversation
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.
I added some questions.
Since this issue is related to topic policies, I'd like to bring up to attention also issue #21303. Topic policy mutations aren't thread safe and just wondering if there are cases that could lead to replication clusters being removed if the policies get mutated in a way where replication clusters are lost. Do we have plans to address #21303?
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
Show resolved
Hide resolved
69d2abd
to
dbf74a6
Compare
…evel replication (apache#22890) (cherry picked from commit feae589) (cherry picked from commit 3f28fa3)
…evel replication (apache#22890) (cherry picked from commit feae589) (cherry picked from commit 3f28fa3)
…evel replication (apache#22890) (cherry picked from commit feae589) (cherry picked from commit 3f28fa3)
…evel replication (apache#22890) (cherry picked from commit feae589) (cherry picked from commit 3f28fa3)
…evel replication (apache#22890) (cherry picked from commit feae589) Signed-off-by: Zixuan Liu <[email protected]>
Motivation
Background
PersistentTopic.addReplicationCluster
will remove orphan replication cursors, see [fix][broker] Ignore and remove the replicator cursor when the remote cluster is absent #19972pulsar.repl.<remote cluster>
Issue
2
was called before topic-level policies initializing, so it will remove the replicator and cursor when a topic is loading up.latest position
), and all the messages in backlog are lost.This issue may cause messages to be lost when using topic-level Geo-Replication. For example:
{L1: 0~50000, L2: 0~50000, L3: 0~5000}
L1: 10000
now.latest
position(L3: 50001
)L1: 10001 ~ L3: 50000
were lostModifications
Fix the issue: make Mechanism
2
being called after the topic-level policies were loaded.Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: x