Skip to content

Commit

Permalink
fix: L0 segment has been loaded to worker during channel balance (#37748
Browse files Browse the repository at this point in the history
)

issue: #37703

---------

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
  • Loading branch information
weiliu1031 authored Nov 18, 2024
1 parent 5065d77 commit 351463b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions internal/querynodev2/delegator/delegator_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,16 @@ func (sd *shardDelegator) LoadSegments(ctx context.Context, req *querypb.LoadSeg
log := sd.getLogger(ctx)

targetNodeID := req.GetDstNodeID()
if len(req.GetInfos()) > 0 && req.GetInfos()[0].Level == datapb.SegmentLevel_L0 {
// force l0 segment to load on delegator
if targetNodeID != paramtable.GetNodeID() {
targetNodeID = paramtable.GetNodeID()
log.Info("unexpected L0 segment load on non-delegator node, force to load on delegator", zap.Int64("nodeIDInReq", req.GetDstNodeID()))
}
}
// add common log fields
log = log.With(
zap.Int64("workID", req.GetDstNodeID()),
zap.Int64("workID", targetNodeID),
zap.Int64s("segments", lo.Map(req.GetInfos(), func(info *querypb.SegmentLoadInfo, _ int) int64 { return info.GetSegmentID() })),
)

Expand All @@ -424,7 +431,7 @@ func (sd *shardDelegator) LoadSegments(ctx context.Context, req *querypb.LoadSeg
return err
}

req.Base.TargetID = req.GetDstNodeID()
req.Base.TargetID = targetNodeID
log.Debug("worker loads segments...")

sLoad := func(ctx context.Context, req *querypb.LoadSegmentsRequest) error {
Expand Down

0 comments on commit 351463b

Please # to comment.