milvus/internal/querycoordv2/task
wei liu b08d9efe69
fix: Prevent delegator unserviceable due to shard leader change (#42689) (#43309)
issue: #42098 #42404
pr: #42689
Fix critical issue where concurrent balance segment and balance channel
operations cause delegator view inconsistency. When shard leader
switches between load and release phases of segment balance, it results
in loading segments on old delegator but releasing on new delegator,
making the new delegator unserviceable.

The root cause is that balance segment modifies delegator views, and if
these modifications happen on different delegators due to leader change,
it corrupts the delegator state and affects query availability.

Changes include:
- Add shardLeaderID field to SegmentTask to track delegator for load
- Record shard leader ID during segment loading in move operations
- Skip release if shard leader changed from the one used for loading
- Add comprehensive unit tests for leader change scenarios

This ensures balance segment operations are atomic on single delegator,
preventing view corruption and maintaining delegator serviceability.

---------

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2025-07-15 17:46:51 +08:00
..
OWNERS Add OWNERS files for querycoordv2 sub pkgs (#23489) 2023-04-18 15:52:30 +08:00
action.go fix: [2.5]fix the garbage cleanup logic of jsonkey stats && improve json key stats filer (#40039) 2025-03-13 20:18:10 +08:00
executor.go fix: Prevent delegator unserviceable due to shard leader change (#42689) (#43309) 2025-07-15 17:46:51 +08:00
executor_test.go fix: Prevent delegator unserviceable due to shard leader change (#42689) (#43309) 2025-07-15 17:46:51 +08:00
mock_scheduler.go fix: [2.5] mockery too unavailable after upgrade golang version (#41522) 2025-04-25 14:40:40 +08:00
scheduler.go fix: [2.5] Fix task delta cache data race (#40262) 2025-03-02 16:52:10 +08:00
task.go fix: Prevent delegator unserviceable due to shard leader change (#42689) (#43309) 2025-07-15 17:46:51 +08:00
task_test.go fix: Prevent delegator unserviceable due to shard leader change (#42689) (#43309) 2025-07-15 17:46:51 +08:00
utils.go fix: [2.5] Check field mmap property before apply collection level one (#43091) 2025-07-03 14:32:45 +08:00
utils_test.go enhance: Revert "separate for index completed (#40873)" (#41152) 2025-04-08 17:36:30 +08:00