Retry on REPLICATE_VIOLATION for global cluster region switch#1773
Retry on REPLICATE_VIOLATION for global cluster region switch#1773sre-ci-robot merged 1 commit intomilvus-io:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: yhmo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
This PR adds retry support for STREAMING_CODE_REPLICATE_VIOLATION errors in the RpcUtils retry loop, enabling automatic topology refresh and retry when a global cluster region switch occurs. Previously, only gRPC UNAVAILABLE errors triggered topology refresh; now, server-side replicate violation errors also trigger refresh and allow the retry loop to continue.
Changes:
- Added
handleGlobalRoutingErrormethod to detectSTREAMING_CODE_REPLICATE_VIOLATIONin exception messages, trigger topology refresh, and signal that retry should continue. - Refactored inline
UNAVAILABLEerror handling into a dedicatedhandleGlobalConnectionErrormethod for better separation of concerns. - Added three new tests covering: routing error triggers refresh, normal errors don't trigger refresh, and no NPE when no refresh trigger is configured.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
sdk-core/src/main/java/io/milvus/v2/utils/RpcUtils.java |
Added GLOBAL_ROUTING_ERROR constant, extracted error handling into two helper methods, and restructured retry logic to also retry on replicate violation errors. |
sdk-core/src/test/java/io/milvus/v2/client/globalcluster/GlobalClusterTest.java |
Updated comment for existing test and added three new tests for the replicate violation retry behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: yhmo <yihua.mo@zilliz.com>
No description provided.