Skip to content

fix: parse legacy LeaderHint from Oxia 0.16.x servers - #368

Closed
mattisonchao wants to merge 1 commit into
mainfrom
fix-leader-hint-016-compat
Closed

fix: parse legacy LeaderHint from Oxia 0.16.x servers#368
mattisonchao wants to merge 1 commit into
mainfrom
fix-leader-hint-016-compat

Conversation

@mattisonchao

Copy link
Copy Markdown
Member

Motivation

The Java client only reads the shard-leader redirect from google.rpc.ErrorInfo metadata, which Oxia servers publish from 0.17.0. Servers on the 0.16.x line (including 0.16.8) attach the redirect as a proto.LeaderHint status detail instead. With a 0.8.0+ client against a 0.16.x server, the redirect is invisible to the client: retries keep targeting the client's cached (stale) shard leader and node is not leader for shard N errors persist until the client process restarts and re-fetches shard assignments. This was observed in production for ~6.5 hours after an Oxia pod replacement.

Modifications

  • Add a LeaderHint message to the client proto, mirroring the 0.16.x server definition (shard, leader_address).
  • Parse the legacy LeaderHint gRPC status detail in OxiaStatusException and surface it through the existing shard/leader metadata, so getLeaderHint() works against 0.16.x servers and retries follow the server-provided leader.
  • Add a unit test covering the legacy 0.16.x wire format (type.googleapis.com/io.oxia.proto.v1.LeaderHint).

Testing

  • ./gradlew :client:test --tests io.oxia.client.grpc.OxiaStatusExceptionTest --tests io.oxia.client.grpc.GrpcRpcProviderTest passes.
  • :client:spotlessJavaCheck passes for the changed files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant