mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 03:48:37 +08:00
fix: Check latest leader exists before using it (#31500)
See also #31495 --------- Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
f65a796d18
commit
4d2142d041
@ -364,13 +364,13 @@ func (c *SegmentChecker) createSegmentLoadTasks(ctx context.Context, segments []
|
||||
plans := make([]balance.SegmentAssignPlan, 0)
|
||||
for shard, segments := range shardSegments {
|
||||
// if channel is not subscribed yet, skip load segments
|
||||
if len(c.dist.LeaderViewManager.GetLeadersByShard(shard)) == 0 {
|
||||
leader := c.dist.LeaderViewManager.GetLatestLeadersByReplicaShard(replica, shard)
|
||||
if leader == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
// L0 segment can only be assign to shard leader's node
|
||||
if isLevel0 {
|
||||
leader := c.dist.LeaderViewManager.GetLatestLeadersByReplicaShard(replica, shard)
|
||||
availableNodes = []int64{leader.ID}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user