-
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
[feat] [broker] PIP-188: Support option to disconnect clients that not support cluster migration feature #20084
base: master
Are you sure you want to change the base?
Conversation
…r migration feature
The pr had no activity for 30 days, mark with Stale label. |
@eolivelli This PR is needed for client proto version enforcement |
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.
Overall, looks good. Two minor comments.
+ "might be required by broker to apply globally on all topics." | ||
+ "(eg: all clients must be on V20 to perform cloud migration)" | ||
) | ||
private int clientMinVersionAllowed = -1; |
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.
Would it make sense to add proto or protocol to the name to disambiguate it from the library version?
doc = "Minimum client version allowed by broker else broker will reject connection." | ||
+ "(It's useful when client lib doesn't support specific feature and feature " | ||
+ "might be required by broker to apply globally on all topics." | ||
+ "(eg: all clients must be on V20 to perform cloud migration)" |
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.
Since it's an int, should we just say 20, not V20?
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.
+1
I have left a minor suggestion
log.info("[{}] client with version {} must be upgraded to {}", remoteAddress, clientProtoVersion, | ||
clientMinVersionAllowed); | ||
final ByteBuf msg = Commands.newError(-1, ServerError.UnsupportedVersionError, | ||
"Upgrade version to " + clientMinVersionAllowed + " or higher"); |
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.
What about 'upgrade your client to a version that supports protocol version ...'
Otherwise it seems that you have to upgrade to Pulsar 20
The pr had no activity for 30 days, mark with Stale label. |
Motivation
As discussed at PIP-188 and in PR #19605
In ordered to achieve cluster migration, all clients need to be upgraded to the version which handles cluster migration redirection. So, Broker can't complete migration if clients are not upgrade to the supported version. Therefore, it's really important to find out if any unsupported client is connected or don't allow any unsupported client to connect if we want to start the cluster migration process. Therefore, we will add a flag to allow the broker to reject all client connections which are initiated from unsupported clients. The broker will not allow connection from clients which don't support cluster migration redirection handling if the
clientMinVersionAllowed
broker flag is enabled.Modifications
Add flag
clientMinVersionAllowed
to allow brokers to ocreate connections with only those clients that support cluster migration handling feature to avoid incomplete cluster migration process.Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: