Skip to content

feat: always send ApiVersionsRequest and fallback to v0#3234

Merged
dnwe merged 1 commit intomainfrom
dnwe/use-apiversions-by-default
Aug 6, 2025
Merged

feat: always send ApiVersionsRequest and fallback to v0#3234
dnwe merged 1 commit intomainfrom
dnwe/use-apiversions-by-default

Conversation

@dnwe
Copy link
Copy Markdown
Collaborator

@dnwe dnwe commented Aug 3, 2025

We previously pinned to only sending if Version was set to v2.4.0.0, but we should always send the request regardless, but fallback to sending a v0 request (without client info) if the v3 request does not succeed

In functional tests we always use MaxVersion in config an ApiVersionsRequest enabled to negotiate versions.

In unittests we disable ApiVersionsRequest by default and pin Version. A number of these tests use step-by-step ordered protocol expectations and it isn't convenient to update them all to also include an ApiVersionsRequest roundtrip unnecessarily, so we disable it in plain unittests by default, keeping it as opt-in.

We previously pinned to only sending if Version was set to v2.4.0.0, but
we should always send the request regardless, but fallback to sending a
v0 request (without client info) if the v3 request does not succeed

In functional tests we always use MaxVersion in config an
ApiVersionsRequest enabled to negotiate versions.

In unittests we disable ApiVersionsRequest by default and pin Version. A
number of these tests use step-by-step ordered protocol expectations and
it isn't convenient to update them all to also include an
ApiVersionsRequest roundtrip unnecessarily, so we disable it in plain
unittests by default, keeping it as opt-in.

Signed-off-by: Dominic Evans <[email protected]>
Co-authored-by: Giorgio Pellero <[email protected]>
@dnwe dnwe added the feat label Aug 3, 2025
// Don't return here - continue without API version discovery
} else {
// send a v0 request in case remote cluster is < 2.4.0.0
apiVersionsResponse, _ = b.sendAndReceiveApiVersions(0)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👌 I missed this detail in my original PR.

@dnwe dnwe merged commit 58355b5 into main Aug 6, 2025
17 checks passed
@dnwe dnwe deleted the dnwe/use-apiversions-by-default branch August 6, 2025 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants