-
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
[improve][broker]fix broker irrational behavior when it is closing #17085
Conversation
/pulsarbot run-failure-checks |
@HQebupt Please check the failed test |
9269665
to
be848ea
Compare
be848ea
to
2248742
Compare
2248742
to
fa459c7
Compare
Thank you Penghui. I found the key point. |
/pulsarbot run-failure-checks |
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
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.
The change looks good to me.
Looks like we also need to check other cases (e.g. handleConnect)
If the broker is shutting down, we should also prevent new connections.
…2.9-wxg-release' (merge request !53) [improve][broker] fix broker irrational behavior when it is closing (apache#17085) 1. [[improve][broker]fix broker irrational behavior when it is closing by HQebupt · Pull Request apache#17085 · apache/pulsar](apache#17085) 2. [[improve][broker]prevent new connection request when broker is closing by HQebupt · Pull Request apache#17314 · apache/pulsar](apache#17314) 3. [[improve][broker]prevent partitioned metadata lookup request when broker is closing by HQebupt · Pull Request apache#17315 · apache/pulsar](apache#17315)
…pache#17085) (cherry picked from commit 4538723)
Motivation
When the leader broker is closing, and it will release the ownership of its bundles first. The client will redo topic lookup , and this broker will handle it, resulting in unexpected results. For instance, some unassigned bundles maybe are taken ownership by itself again, but the broker can not server the bundles due to it is closing . see the screenshot log.
Therefore, it is necessary to check the status of the broker when handling lookup requests.
Modifications
PulsarService
sincePulsarFunctionWorker
have to lookup topic when broker is starting.pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
Lines 855 to 856 in 4a28c08
pulsar/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/PulsarWorkerService.java
Lines 445 to 447 in 4a28c08
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
Check the box below and label this PR (if you have committer privilege).
Need to update docs?
doc-not-needed