mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
fix: unstable integration test caused by paramtable.GetNodeID (#37909)
issue: #37908 cause paramtable is global single instance, which cause paramtable.GetNodeID may return wrong server id in integration test. This PR use node.GetNodeID to replace paramtable.GetNodeID Signed-off-by: Wei Liu <wei.liu@zilliz.com>
This commit is contained in:
parent
1dc1a97e65
commit
5f3601a6a5
@ -403,13 +403,6 @@ func (sd *shardDelegator) LoadSegments(ctx context.Context, req *querypb.LoadSeg
|
|||||||
log := sd.getLogger(ctx)
|
log := sd.getLogger(ctx)
|
||||||
|
|
||||||
targetNodeID := req.GetDstNodeID()
|
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
|
// add common log fields
|
||||||
log = log.With(
|
log = log.With(
|
||||||
zap.Int64("workID", targetNodeID),
|
zap.Int64("workID", targetNodeID),
|
||||||
|
|||||||
@ -457,6 +457,14 @@ func (node *QueryNode) LoadSegments(ctx context.Context, req *querypb.LoadSegmen
|
|||||||
return merr.Status(err), nil
|
return merr.Status(err), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(req.GetInfos()) > 0 && req.GetInfos()[0].Level == datapb.SegmentLevel_L0 {
|
||||||
|
// force l0 segment to load on delegator
|
||||||
|
if req.DstNodeID != node.GetNodeID() {
|
||||||
|
log.Info("unexpected L0 segment load on non-delegator node, force to load on delegator")
|
||||||
|
req.DstNodeID = node.GetNodeID()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
req.NeedTransfer = false
|
req.NeedTransfer = false
|
||||||
err := delegator.LoadSegments(ctx, req)
|
err := delegator.LoadSegments(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user