fix: support leader lookup with Oxia 0.16.x - #373
Merged
Conversation
mattisonchao
force-pushed
the
fix-leader-hint-016-compat
branch
2 times, most recently
from
September 7, 2026 04:41
6d3fc40 to
b6c7b7b
Compare
mattisonchao
force-pushed
the
fix-leader-hint-016-compat
branch
3 times, most recently
from
September 7, 2026 08:03
5d24c13 to
534bcca
Compare
Signed-off-by: mattisonchao <mattisonchao@gmail.com>
mattisonchao
force-pushed
the
fix-leader-hint-016-compat
branch
from
September 7, 2026 08:24
534bcca to
3495506
Compare
Signed-off-by: mattisonchao <mattisonchao@gmail.com>
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.
Motivation
The Java client supports shard-leader redirects from the
google.rpc.ErrorInfometadata used by Oxia 0.17.0 and newer. Oxia 0.16.x instead returns custom gRPC status code106with anio.oxia.proto.v1.LeaderHintprotobuf detail.gRPC Java normalizes code
106toUNKNOWNand rejects the rich status because the normalized code no longer matches the status-details trailer. As a result, the client cannot see the leader hint and can keep retrying a stale cached leader after a failover.Modifications
LeaderHintmessage with the same wire fields used by Oxia 0.16.x.106andLeaderHintdirectly into anOxiaStatusExceptioninLegacyLeaderHintStatusDecoder.ErrorInfo, standard-code, and message fallback handling inStandardGrpcStatusDecoder.UNKNOWNwhen a decoder does not recognize the error soOxiaStatusExceptioncan continue to the next strategy without an intermediate result orOptional.Testing
./gradlew :client:spotlessCheck./gradlew :client:spotbugsMain./gradlew :client:test --tests "*Test"./gradlew :client:test --tests io.oxia.client.grpc.OxiaStatusExceptionTest --tests io.oxia.client.grpc.GrpcRpcProviderTest