mirror of https://github.com/milvus-io/milvus.git
enhance: Set the timeout for SyncSegments based on the number of segments (#34228)
issue: #32809 master pr: #34226 Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>pull/34277/head
parent
9cb3658d74
commit
85aa929749
|
@ -217,7 +217,8 @@ func (c *SessionManagerImpl) SyncSegments(nodeID int64, req *datapb.SyncSegments
|
|||
zap.Int64("nodeID", nodeID),
|
||||
zap.Int64("planID", req.GetPlanID()),
|
||||
)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), Params.DataCoordCfg.CompactionRPCTimeout.GetAsDuration(time.Second))
|
||||
timeout := Params.DataCoordCfg.CompactionRPCTimeout.GetAsDuration(time.Second) * time.Duration(max(len(req.GetSegmentInfos())/10, 1))
|
||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||
defer cancel()
|
||||
cli, err := c.getClient(ctx, nodeID)
|
||||
if err != nil {
|
||||
|
@ -226,7 +227,7 @@ func (c *SessionManagerImpl) SyncSegments(nodeID int64, req *datapb.SyncSegments
|
|||
}
|
||||
|
||||
err = retry.Do(context.Background(), func() error {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), Params.DataCoordCfg.CompactionRPCTimeout.GetAsDuration(time.Second))
|
||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||
defer cancel()
|
||||
|
||||
resp, err := cli.SyncSegments(ctx, req)
|
||||
|
|
|
@ -3148,10 +3148,10 @@ During compaction, the size of segment # of rows is able to exceed segment max #
|
|||
p.ChannelCheckpointMaxLag.Init(base.mgr)
|
||||
|
||||
p.SyncSegmentsInterval = ParamItem{
|
||||
Key: "dataCoord.sync.interval",
|
||||
Version: "2.4.3",
|
||||
Key: "dataCoord.syncSegmentsInterval",
|
||||
Version: "2.4.6",
|
||||
Doc: "The time interval for regularly syncing segments",
|
||||
DefaultValue: "600", // 10 * 60 seconds
|
||||
DefaultValue: "300", // 5 * 60 seconds
|
||||
}
|
||||
p.SyncSegmentsInterval.Init(base.mgr)
|
||||
|
||||
|
|
Loading…
Reference in New Issue