Repository navigation
Conversation
Classify UNIMPLEMENTED at the gRPC boundary so callers can retain keyspace scope when falling back. Reject legacy safe-point responses carrying PD header errors. Signed-off-by: ruiyu.wu <ruiyu.wu@pingcap.cn>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @rafa-w7! |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Why this change is needed
A caller that reads a GC safe point needs to distinguish an unsupported PD method from a temporary failure. When an older PD returns gRPC
UNIMPLEMENTEDforGetGCState, its numeric status (12) collides withServerIsBusyin the client. The caller can then keep retrying a method the server cannot provide. The legacy safe-point methods can also return the protobuf default timestamp when the RPC succeeds but the PD response header contains an error.What changes
getGCStatetranslates gRPCUNIMPLEMENTEDinto the existingGRPCNotImplementedclient error before triggering a leader refresh. Other RPC errors continue through their existing handling. Both legacy safe-point methods check the PD response header before returning the timestamp. Callers retain control over whether to fall back and which keyspace to use.Validation
PDGCClient.DistinguishesUnsupportedRPCAndRejectsHeaderErrorsregression passed against a test gRPC service. It exercises a successful lookup, unsupported and transient RPC errors, and errors returned in response headers.293e94cd). A clean TiUP deployment initialized both table replicas, applied committed changes, and caught up after a restart. All ten SQL result comparisons agreed with TiKV. At one transaction snapshot after restart, both engines returned 11,869 ordinary rows and 8,113 Blob rows. This integration also included the downstream changes that select the appropriate fallback.Summary by CodeRabbit