[Backport 2.6] fix: retry on REPLICATE_VIOLATION for global cluster region switch (#3285)#3298
Merged
sre-ci-robot merged 1 commit into2.6from Mar 3, 2026
Merged
Conversation
…3285) ## Summary - When a Global Cluster switches its primary region, write operations to the old primary (now secondary) fail with `STREAMING_CODE_REPLICATE_VIOLATION` - Previously this `MilvusException` was not handled in the retry decorator, so writes failed for up to 5 minutes until the background `TopologyRefresher` (300s interval) detected the change - Add `_handle_global_routing_error()` in `GrpcHandler` to detect `REPLICATE_VIOLATION` and trigger immediate topology refresh - Hook it into the `retry_on_rpc_failure` decorator's `MilvusException` branch (both sync and async) so the operation retries automatically after refresh ## Test plan - [x] Deploy a Global Cluster on Zilliz Cloud (UAT) - [x] Run continuous insert + search loop - [x] Switch primary region in console - [x] **Before fix**: INSERT fails with `REPLICATE_VIOLATION` for ~5 minutes until background refresh - [x] **After fix**: INSERT auto-recovers in ~10 seconds (topology refresh + retry backoff) - [x] Unit tests for `_handle_global_routing_error` (4 new tests, all passing) --------- Signed-off-by: huanghaoyuanhhy <haoyuan.huang@zilliz.com> (cherry picked from commit 4d607f3) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.6 #3298 +/- ##
==========================================
+ Coverage 76.39% 76.42% +0.03%
==========================================
Files 63 63
Lines 12946 12954 +8
==========================================
+ Hits 9890 9900 +10
+ Misses 3056 3054 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pymilvus-bot, XuanYang-cn 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 |
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.
Backport of #3285 to
2.6.