未验证 提交 eef29546 编写于 作者: X XuanYang-cn 提交者: GitHub

Fix timetick inconsistency in drop collection (#15408)

When rootcoord drops a collection, it'll produce a `drop-collection DDL` msg
and one last timetick into DML channels of this collection.
So that when DataNode receives this msg, DN can release the resources for the specific collection.

Before this PR, RootCoord produced these two msgs with an older timestamp, generated
before many time-consuming RPCs.

Once these RPCs spend more time than timetick producing interval, the timetick of these 2 msgs are
older to the channel current timestamp, causing in-consistency in time, thus
making msgstream fail to consume the last `drop-collection DDL` msg.

This PR generates a new timestamp for `drop-collection DDL` msg and timetick msg after those time-consuming
RPCs

Fixes: #15406
Signed-off-by: Nyangxuan <xuan.yang@zilliz.com>
上级 4b83bbf8
......@@ -303,6 +303,17 @@ func (t *DropCollectionReqTask) Execute(ctx context.Context) error {
return err
}
// drop all indices
if err = t.core.RemoveIndex(ctx, t.Req.CollectionName, ""); err != nil {
return err
}
// Allocate a new ts to make sure the channel timetick is consistent.
ts, err = t.core.TSOAllocator(1)
if err != nil {
return fmt.Errorf("TSO alloc fail, error = %w", 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
......@@ -311,11 +322,6 @@ func (t *DropCollectionReqTask) Execute(ctx context.Context) error {
return fmt.Errorf("encodeDdOperation fail, error = %w", err)
}
// drop all indices
if err = t.core.RemoveIndex(ctx, t.Req.CollectionName, ""); err != nil {
return err
}
// get all aliases before meta table updated
aliases := t.core.MetaTable.ListAliases(collMeta.ID)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册