未验证 提交 e97936ba 编写于 作者: Y yukun 提交者: GitHub

Fix query hang bug (#5709)

Signed-off-by: Nfishpenguin <kun.yu@zilliz.com>
上级 34636638
......@@ -1217,7 +1217,7 @@ func (node *ProxyNode) Retrieve(ctx context.Context, request *milvuspb.RetrieveR
zap.String("db", request.DbName),
zap.String("collection", request.CollectionName),
zap.Any("partitions", request.PartitionNames),
zap.Any("len(Ids)", len(request.Ids.IdField.(*schemapb.IDs_IntId).IntId.Data)))
zap.Any("len(Ids)", len(rt.result.Ids.IdField.(*schemapb.IDs_IntId).IntId.Data)))
}()
err = rt.WaitToFinish()
......@@ -1368,7 +1368,7 @@ func (node *ProxyNode) Query(ctx context.Context, request *milvuspb.QueryRequest
zap.String("db", retrieveRequest.DbName),
zap.String("collection", retrieveRequest.CollectionName),
zap.Any("partitions", retrieveRequest.PartitionNames),
zap.Any("len(Ids)", len(retrieveRequest.Ids.IdField.(*schemapb.IDs_IntId).IntId.Data)))
zap.Any("len(Ids)", len(rt.result.Ids.IdField.(*schemapb.IDs_IntId).IntId.Data)))
}()
err = rt.WaitToFinish()
......
......@@ -94,6 +94,12 @@ func (rc *retrieveCollection) getServiceableTime() Timestamp {
func (rc *retrieveCollection) setServiceableTime(t Timestamp) {
rc.serviceableTimeMutex.Lock()
defer rc.serviceableTimeMutex.Unlock()
if t < rc.serviceableTime {
return
}
gracefulTimeInMilliSecond := Params.GracefulTime
if gracefulTimeInMilliSecond > 0 {
gracefulTime := tsoutil.ComposeTS(gracefulTimeInMilliSecond, 0)
......@@ -101,7 +107,6 @@ func (rc *retrieveCollection) setServiceableTime(t Timestamp) {
} else {
rc.serviceableTime = t
}
rc.serviceableTimeMutex.Unlock()
}
func (rc *retrieveCollection) waitNewTSafe() Timestamp {
......@@ -128,7 +133,7 @@ func (rc *retrieveCollection) start() {
func (rc *retrieveCollection) register() {
// register tSafe watcher and init watcher select case
collection, err := rc.historicalReplica.getCollectionByID(rc.collectionID)
collection, err := rc.streamingReplica.getCollectionByID(rc.collectionID)
if err != nil {
log.Error(err.Error())
return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册