mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 10:08:42 +08:00
fix search timeout error (#6027)
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
parent
0f89f40488
commit
dca24f313a
@ -469,40 +469,50 @@ func (r *releasePartitionsTask) Execute(ctx context.Context) error {
|
||||
zap.Any("collectionID", r.req.CollectionID),
|
||||
zap.Any("partitionIDs", r.req.PartitionIDs))
|
||||
|
||||
const gracefulReleaseTime = 1
|
||||
func() { // release synchronously
|
||||
errMsg := "release partitions failed, collectionID = " + strconv.FormatInt(r.req.CollectionID, 10) + ", err = "
|
||||
time.Sleep(gracefulReleaseTime * time.Second)
|
||||
|
||||
hCol, err := r.node.historical.replica.getCollectionByID(r.req.CollectionID)
|
||||
if err != nil {
|
||||
log.Error(err.Error())
|
||||
return err
|
||||
log.Error(errMsg + err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
sCol, err := r.node.streaming.replica.getCollectionByID(r.req.CollectionID)
|
||||
if err != nil {
|
||||
log.Error(err.Error())
|
||||
return err
|
||||
log.Error(errMsg + err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
for _, id := range r.req.PartitionIDs {
|
||||
r.node.streaming.dataSyncService.removePartitionFlowGraph(id)
|
||||
hasPartitionInHistorical := r.node.historical.replica.hasPartition(id)
|
||||
if hasPartitionInHistorical {
|
||||
err := r.node.historical.replica.removePartition(id)
|
||||
err = r.node.historical.replica.removePartition(id)
|
||||
if err != nil {
|
||||
// not return, try to release all partitions
|
||||
log.Error(err.Error())
|
||||
log.Error(errMsg + err.Error())
|
||||
}
|
||||
}
|
||||
hCol.addReleasedPartition(id)
|
||||
|
||||
hasPartitionInStreaming := r.node.streaming.replica.hasPartition(id)
|
||||
if hasPartitionInStreaming {
|
||||
err := r.node.streaming.replica.removePartition(id)
|
||||
err = r.node.streaming.replica.removePartition(id)
|
||||
if err != nil {
|
||||
log.Error(err.Error())
|
||||
log.Error(errMsg + err.Error())
|
||||
}
|
||||
}
|
||||
sCol.addReleasedPartition(id)
|
||||
}
|
||||
|
||||
log.Debug("release partition task done",
|
||||
zap.Any("collectionID", r.req.CollectionID),
|
||||
zap.Any("partitionIDs", r.req.PartitionIDs))
|
||||
}()
|
||||
|
||||
log.Debug("release partition task done",
|
||||
zap.Any("collectionID", r.req.CollectionID),
|
||||
zap.Any("partitionIDs", r.req.PartitionIDs))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user