milvus/internal/querycoordv2/checkers
wei liu 4fd56e4773
fix: Prevent leader checker from generating excessive duplicate leader tasks (#39000) (#39160)
issue: #39001
pr: #39000
Background:
Segment Load Version: Each segment load request assigns a timestamp as
its version. When multiple copies of a segment are loaded on different
QueryNodes, the leader checker uses this version to identify the latest
copy and updates the routing table in the leader view to point to it.
Delegator Router Version: When a delegator builds a route to a QueryNode
that has loaded a segment, it also records the segment's version.

Router Table Update Logic: If the leader checker detects that the
version of a segment in the routing table does not match the version in
the worker, it updates the routing table to point to the QueryNode with
the latest version. Additionally, it updates the segment's load version
in the QueryNode during this process.

Issue:
When a channel is undergoing load balancing, the leader checker may sync
the routing table to a new delegator. This sync operation modifies the
segment's load version, which invalidates the routing in the old
delegator. Subsequently, the leader checker updates the routing table in
the old delegator, breaking the routing in the new delegator. This cycle
continues, causing repeated updates and inconsistencies.

Fix:
This PR introduces two changes to address the issue:
1. Use NodeID to verify whether the delegator's routing table needs an
update, avoiding unnecessary modifications.
2. Ensure compatibility by using the latest segment's load version as
the version recorded in the routing table.

These changes resolve the cyclic updates and prevent the leader checker
from generating excessive duplicate tasks, ensuring routing stability
across delegators during load balancing.

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2025-01-14 18:11:06 +08:00
..
OWNERS Add OWNERS files for querycoordv2 sub pkgs (#23489) 2023-04-18 15:52:30 +08:00
balance_checker.go enhance: make new go package to manage proto (#39128) 2025-01-10 10:53:01 +08:00
balance_checker_test.go enhance: make new go package to manage proto (#39128) 2025-01-10 10:53:01 +08:00
channel_checker.go enhance: Remove load task limit in one round (#38436) 2024-12-16 19:30:43 +08:00
channel_checker_test.go enhance: make new go package to manage proto (#39128) 2025-01-10 10:53:01 +08:00
checker.go enhance: refactor leader_observer to leader_checker (#29454) 2024-01-05 15:54:55 +08:00
controller.go enhance: Skip update index for L0 segment (#34099) 2024-07-01 10:26:06 +08:00
controller_base_test.go enhance: move rocksmq from internal to pkg module (#33881) 2024-06-25 21:18:15 +08:00
controller_test.go enhance: make new go package to manage proto (#39128) 2025-01-10 10:53:01 +08:00
index_checker.go enhance: make new go package to manage proto (#39128) 2025-01-10 10:53:01 +08:00
index_checker_test.go enhance: make new go package to manage proto (#39128) 2025-01-10 10:53:01 +08:00
leader_checker.go fix: Prevent leader checker from generating excessive duplicate leader tasks (#39000) (#39160) 2025-01-14 18:11:06 +08:00
leader_checker_test.go fix: Prevent leader checker from generating excessive duplicate leader tasks (#39000) (#39160) 2025-01-14 18:11:06 +08:00
segment_checker.go enhance: make new go package to manage proto (#39128) 2025-01-10 10:53:01 +08:00
segment_checker_test.go enhance: make new go package to manage proto (#39128) 2025-01-10 10:53:01 +08:00