wei liu dc18d2aa8a
fix: Use leaderID for LeaderAction stale check in scheduler (#46785)
issue: #46737

PR #46440 refactored checkStale to use action.Node() for all action
types, which breaks LeaderAction stale checking. For LeaderAction,
Node() returns the worker node where segment resides, but the task is
executed on the leader node (delegator).

When syncing segments from RO worker nodes to a RW delegator, using
action.Node() incorrectly marks the task as stale because the worker is
RO, even though the leader is RW and the task should proceed.

This fix:
- Uses leaderID instead of Node() for LeaderAction stale checking
- Adds detailed comments explaining the distinction
- Adds unit tests covering the RO worker with RW leader scenario

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
2026-01-06 18:27:24 +08:00
..
2025-12-31 15:35:21 +08:00