-
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] Fix infinite ack of Replicator after topic is closed #20232
Merged
Technoboy-
merged 2 commits into
apache:master
from
poorbarcode:fix/infinite_cursor_delete_after_topic_closed
May 7, 2023
Merged
[fix] [broker] Fix infinite ack of Replicator after topic is closed #20232
Technoboy-
merged 2 commits into
apache:master
from
poorbarcode:fix/infinite_cursor_delete_after_topic_closed
May 7, 2023
Conversation
This file contains 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
liangyepianzhou
approved these changes
May 5, 2023
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 work!
codelipenghui
approved these changes
May 5, 2023
Technoboy-
approved these changes
May 6, 2023
/pulsarbot rerun-failure-checks |
Codecov Report
@@ Coverage Diff @@
## master #20232 +/- ##
=============================================
+ Coverage 34.48% 72.90% +38.42%
- Complexity 12537 31961 +19424
=============================================
Files 1614 1868 +254
Lines 126170 138597 +12427
Branches 13771 15247 +1476
=============================================
+ Hits 43509 101044 +57535
+ Misses 77053 29518 -47535
- Partials 5608 8035 +2427
Flags with carried forward coverage won't be shown. Click here to find out more.
|
congbobo184
approved these changes
May 6, 2023
lifepuzzlefun
approved these changes
May 6, 2023
/pulsarbot rerun-failure-checks |
nicoloboschi
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 11, 2023
…pache#20232) (cherry picked from commit 9841364) (cherry picked from commit c934df7)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/geo-replication
cherry-picked/branch-2.10
cherry-picked/branch-2.11
cherry-picked/branch-3.0
doc-not-needed
Your PR changes do not impact docs
release/2.10.5
release/2.11.2
release/3.0.1
type/bug
The PR fixed a bug or issue reported a bug
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
In the scenarios[1] below, the replicator only acknowledges messages and does not replicate them, but if the topic is closing now, the operation acknowledge(in other words:
cursor.asyncDelete
) will be failed by the errorCursor was already closed
, then it will retry again(see the code [2]) and fail again....loop.[1]: scenarios of skip messages:
[2]: Code of retry to acknowledge messages.
https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java#L545
Note: I tried to write a test, but it took me more than an hour but failed, so there was no test of this change.
Modifications
Just like the existing solution of
read entry fail
(see the code [3]): if ack failed byCursorAlreadyClosedException
, just close the replicator(will not retry).[3]: Code of the existing solution of
read entry fail
https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java#L434
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: