Fix QueryNode may report succeeded to unsubscribe channel early (#23580)

Signed-off-by: yah01 <yang.cen@zilliz.com>
pull/23586/head
yah01 2023-04-20 19:30:33 +08:00 committed by GitHub
parent 5bda7ca641
commit 71364056f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -322,14 +322,16 @@ func (node *QueryNode) UnsubDmChannel(ctx context.Context, req *querypb.UnsubDmC
return status, nil
}
delegator, loaded := node.delegators.GetAndRemove(req.GetChannelName())
if loaded {
delegator, ok := node.delegators.Get(req.GetChannelName())
if ok {
// close the delegator first to block all coming query/search requests
delegator.Close()
}
node.pipelineManager.Remove(req.GetChannelName())
node.manager.Segment.RemoveBy(segments.WithChannel(req.GetChannelName()))
node.tSafeManager.Remove(req.GetChannelName())
node.pipelineManager.Remove(req.GetChannelName())
node.manager.Segment.RemoveBy(segments.WithChannel(req.GetChannelName()))
node.tSafeManager.Remove(req.GetChannelName())
node.delegators.GetAndRemove(req.GetChannelName())
}
log.Info("unsubscribed channel")