-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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: add isValidVersion to protocol types #2538
Conversation
f76c25b
to
26d9b01
Compare
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.
Not sure if all my comments made it but I can't see them in my refreshed review page now.
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.
When adding Version fields, we should probably fix the version functions to return them?
ca24f79
to
70d2c11
Compare
12e0507
to
47c6581
Compare
The intention here is that we can check that a request version value is supported by the protocol encoder/decoder before sending it Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
This is identical to v0 but can used from broker 2.0.0.0 onwards Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
47c6581
to
7b96841
Compare
Testing uncovered a few mismatches between the requiredVersion implementation in the request and response for these types Also fix wrong key() in alter_configs_response! Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
Co-authored-by: Mark Hindess <hindessm@users.noreply.github.com> Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
This is really just proxying to FindCoordinatorRequest/FindCoordinatorResponse, but for now just copy in the same isValidVersion/requiredVersion code and ensure we're passing Version to and from it correctly. Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
Initially seeded with only the protocol versions required for Kafka v1.1, check we've implemented the expected versions and they pass the isValidVersion and the requiredVersion checks as expected. Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
7b96841
to
b8cc2b1
Compare
Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
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
The intention here is to add a common
isValidVersion
to all the protocol types so that we can check that a request version value is supported by the protocol encoder/decoder implementation before sending it (hence avoiding malformed requests on the broker side).Additionally in this PR fixup the existing
requiredVersion
checks where they were incorrect and/or add missing values, also ensuring the request and response implementations were in agreement.Finally add some testing in this area and in a few places start using newer version numbers where the config version value allows.
Contributes-to: #2408