Conversation
Contributor
|
@ss666 Thanks for the pr. One compatibility concern: please see #4416 (comment) |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved cross-version compatibility and version-assertion issues remain.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR adds version negotiation for historical partition lookups.
Changes:
- Bumps
LOOKUPto protocol version 2. - Rejects historical lookups against servers below version 2.
- Adds compatibility tests for normal and historical lookups.
File summaries
| File | Summary |
|---|---|
fluss-rpc/src/test/java/org/apache/fluss/rpc/netty/client/ServerConnectionTest.java |
Tests compatibility with servers advertising LOOKUP v1. |
fluss-rpc/src/main/java/org/apache/fluss/rpc/protocol/ApiKeys.java |
Advertises LOOKUP v2. Critical finding (2 votes): coordinate the matching release-1.0 advertisement. Moderate finding (1 vote): add an explicit v2 assertion to ApiKeysTest. |
fluss-rpc/src/main/java/org/apache/fluss/rpc/netty/client/ServerConnection.java |
Adds version validation for historical lookups. |
Review details
Suppressed comments (1)
fluss-rpc/src/main/java/org/apache/fluss/rpc/protocol/ApiKeys.java:62
- Please add an explicit
ApiKeys.LOOKUP.highestSupportedVersion == 2assertion toApiKeysTest. The newServerConnectionTestwould still pass if this enum accidentally remained at 1, becauseOldLookupGatewayServiceclamps a response that already starts from the same enum; in that case a new server would never negotiate v2 and every historical lookup would be rejected. The existingApiKeysTestalready covers analogous version bumps.
LOOKUP(1017, 0, 2, PUBLIC),
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // primary key, enabling prefix lookup support. | ||
| LOOKUP(1017, 0, 1, PUBLIC), | ||
| // Version 2: Supports original_partition_name in requests and responses for historical lookups. | ||
| LOOKUP(1017, 0, 2, PUBLIC), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Linked issue: close #4416
Part of #3631, follow-up to #3632.
LOOKUPcarriesoriginal_partition_namewithout a version bump, the capability is not detectable and cannot be gated: the field is sent to a server that predates it, and the un-echoed response fails the request on a null dereference.Brief change log
ApiKeys.LOOKUPto version 2, documenting that v2 carriesoriginal_partition_namein requests and responses.HISTORICAL_LOOKUP_MIN_VERSION = 2and aLOOKUPbranch inServerConnection#validateVersionCompatibilitythat rejects historical lookups withUnsupportedVersionException, mirroring the existingPUT_KVandPRODUCE_LOGbranches.ServerConnectionTestwith a server that advertisesLOOKUPv1: a normal lookup still succeeds, a historical lookup is rejected.Tests
./mvnw verify -pl fluss-rpc -am./mvnw test -pl fluss-client -am -Dtest='LookupSenderTest,PrimaryKeyLookuperTest,ClientRpcMessageUtilsTest,LookupQueueTest'./mvnw test -pl fluss-server -am -Dtest='RpcServiceBaseTest,ServerRpcMessageUtilsTest'API and Format
LOOKUPRPC maximum version from 1 to 2. No proto or encoding change; v2 only declares the already-existing optionaloriginal_partition_namefields. No new public Java API and no new configuration option.original_partition_nameat v1, since clients from [lookup] Support historical partition lookup for lake tables #3630 onward already send it there.release-1.0advertises the sameLOOKUPmaximum as0.9, so a bump that lands only onmainwould make the gate reject 1.0 servers that do support historical lookup — worth considering forrelease-1.0as well.Documentation
N/A. No user-facing option or behaviour change.