-
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] Change default behavior when ZK session expired to shutdown #23011
[fix][broker] Change default behavior when ZK session expired to shutdown #23011
Conversation
@poorbarcode The behavior is intended to prevent a temporary loss of a ZK session, to bring down an entire cluster of brokers at the same time. In the example above, when broker-1 will be able to re-establish a session with ZK, it will get the notification that the ownership has changed. For the semantics guarantees, there is no problem or race condition:
|
In this case, broker1 will revalidating the lock and give up the ownership of the topic. And only the request going to broker-1 will get the wrong owner, right? Maybe we can always forward the lookup request to other brokers if the requested broker is waiting for zookeeper reconnection? |
Sure, agree with you. But there is a scenario which is not expected. Let me share a flow to you.
Agree with you, since the improvement that |
This should only be while broker-2 is partitioned from ZK.
Once broker-2 comes back, the ownership won't come back to broker-2 since it's already in broker-0
The clients will get fenced error and then they will re-do the lookup and discover that a different broker is the owner |
So far, it will not unload the topic. I will write a test to reproduce it.
After a shedding, the bundle may switch to
Correct, but the two issues above will lead to the issue can not be recovered. |
You are correct, it will be unloaded. I wrote a test in the below PR The issue that we encountered is below, which is not the same as I described above
new update( A new issue that clients get |
Close this PR |
Motivation
background
broker-1
) ZK session has expired, the topics it owns will be assigned to other brokersbroker-1
will get aBadVersionException
, then the topics will be markedfenced
.broker-1
will get a fenced error.Issue: the topics on
broker-1
will not be unloaded until it restarts, so we'd better change the default behavior of the action when ZK session expires toshutdown
, which will solve the issue automatically. We can set it back toreconnect
after we improve the behavior to unload the topic automatically in the future.Modifications
Change default behavior when ZK session expired to
shutdown
.Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: x