Release collection first when drop collection (#15370)

Signed-off-by: xige-16 <xi.ge@zilliz.com>
This commit is contained in:
xige-16 2022-01-24 21:51:22 +08:00 committed by GitHub
parent 5bc6ec7250
commit 3a024307f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -296,6 +296,12 @@ func (t *DropCollectionReqTask) Execute(ctx context.Context) error {
return fmt.Errorf("TSO alloc fail, error = %w", err)
}
//notify query service to release collection
if err = t.core.CallReleaseCollectionService(t.core.ctx, ts, 0, collMeta.ID); err != nil {
log.Error("Failed to CallReleaseCollectionService", zap.Error(err))
return err
}
// build DdOperation and save it into etcd, when ddmsg send fail,
// system can restore ddmsg from etcd and re-send
ddReq.Base.Timestamp = ts
@ -360,12 +366,6 @@ func (t *DropCollectionReqTask) Execute(ctx context.Context) error {
return err
}
//notify query service to release collection
if err = t.core.CallReleaseCollectionService(t.core.ctx, ts, 0, collMeta.ID); err != nil {
log.Error("Failed to CallReleaseCollectionService", zap.Error(err))
return err
}
t.core.ExpireMetaCache(ctx, []string{t.Req.CollectionName}, ts)
t.core.ExpireMetaCache(ctx, aliases, ts)