mirror of https://github.com/milvus-io/milvus.git
fix: Use `Remove` sync type for distribution removal (#31215)
See also #31214 Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>pull/31170/head
parent
96cfae55a5
commit
5b51c20293
|
@ -516,7 +516,7 @@ func (ex *Executor) removeDistribution(task *LeaderTask, step int) error {
|
||||||
|
|
||||||
req := &querypb.SyncDistributionRequest{
|
req := &querypb.SyncDistributionRequest{
|
||||||
Base: commonpbutil.NewMsgBase(
|
Base: commonpbutil.NewMsgBase(
|
||||||
commonpbutil.WithMsgType(commonpb.MsgType_LoadSegments),
|
commonpbutil.WithMsgType(commonpb.MsgType_SyncDistribution),
|
||||||
commonpbutil.WithMsgID(task.ID()),
|
commonpbutil.WithMsgID(task.ID()),
|
||||||
),
|
),
|
||||||
CollectionID: task.collectionID,
|
CollectionID: task.collectionID,
|
||||||
|
@ -524,24 +524,23 @@ func (ex *Executor) removeDistribution(task *LeaderTask, step int) error {
|
||||||
ReplicaID: task.ReplicaID(),
|
ReplicaID: task.ReplicaID(),
|
||||||
Actions: []*querypb.SyncAction{
|
Actions: []*querypb.SyncAction{
|
||||||
{
|
{
|
||||||
Type: querypb.SyncType_Set,
|
Type: querypb.SyncType_Remove,
|
||||||
SegmentID: action.SegmentID(),
|
SegmentID: action.SegmentID(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
startTs := time.Now()
|
startTs := time.Now()
|
||||||
log.Info("Sync Distribution...")
|
log.Info("Remove Distribution...")
|
||||||
status, err := ex.cluster.SyncDistribution(task.Context(), task.leaderID, req)
|
status, err := ex.cluster.SyncDistribution(task.Context(), task.leaderID, req)
|
||||||
// status, err := ex.cluster.LoadSegments(task.Context(), leaderID, req)
|
|
||||||
err = merr.CheckRPCCall(status, err)
|
err = merr.CheckRPCCall(status, err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn("failed to sync distribution", zap.Error(err))
|
log.Warn("failed to remove distribution", zap.Error(err))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
elapsed := time.Since(startTs)
|
elapsed := time.Since(startTs)
|
||||||
log.Info("sync distribution done", zap.Duration("elapsed", elapsed))
|
log.Info("remove distribution done", zap.Duration("elapsed", elapsed))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue