diff --git a/internal/rootcoord/task.go b/internal/rootcoord/task.go index dfe1577253..05d6028797 100644 --- a/internal/rootcoord/task.go +++ b/internal/rootcoord/task.go @@ -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)