From 6188ac280b517f4e52df2024fb9c76dce5a37d11 Mon Sep 17 00:00:00 2001 From: Cai Yudong Date: Thu, 25 Nov 2021 18:03:17 +0800 Subject: [PATCH] Fix drop alias error (#12281) Signed-off-by: yudong.cai --- internal/rootcoord/task.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/rootcoord/task.go b/internal/rootcoord/task.go index fa2a59c25c..8e0e4a851f 100644 --- a/internal/rootcoord/task.go +++ b/internal/rootcoord/task.go @@ -300,6 +300,9 @@ func (t *DropCollectionReqTask) Execute(ctx context.Context) error { return err } + // get all aliases before meta table updated + aliases := t.core.MetaTable.ListAliases(collMeta.ID) + // use lambda function here to guarantee all resources to be released dropCollectionFn := func() error { // lock for ddl operation @@ -352,8 +355,6 @@ func (t *DropCollectionReqTask) Execute(ctx context.Context) error { } t.core.ExpireMetaCache(ctx, []string{t.Req.CollectionName}, ts) - - aliases := t.core.MetaTable.ListAliases(collMeta.ID) t.core.ExpireMetaCache(ctx, aliases, ts) // Update DDOperation in etcd