Optimize rootcoord reSendDdMsg (#13363)

Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
pull/13371/head
Cai Yudong 2021-12-14 19:15:06 +08:00 committed by GitHub
parent 2cb8b10caa
commit 30e18cb5a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 15 deletions

View File

@ -1055,7 +1055,7 @@ func (c *Core) reSendDdMsg(ctx context.Context, force bool) error {
var invalidateCache bool
var ts typeutil.Timestamp
var dbName, collName string
var collName string
switch ddOp.Type {
// TODO remove create collection resend
@ -1079,7 +1079,7 @@ func (c *Core) reSendDdMsg(ctx context.Context, force bool) error {
return err
}
ts = ddReq.Base.Timestamp
dbName, collName = ddReq.DbName, ddReq.CollectionName
collName = ddReq.CollectionName
collInfo, err := c.MetaTable.GetCollectionByName(ddReq.CollectionName, 0)
if err != nil {
return err
@ -1094,7 +1094,7 @@ func (c *Core) reSendDdMsg(ctx context.Context, force bool) error {
return err
}
ts = ddReq.Base.Timestamp
dbName, collName = ddReq.DbName, ddReq.CollectionName
collName = ddReq.CollectionName
collInfo, err := c.MetaTable.GetCollectionByName(ddReq.CollectionName, 0)
if err != nil {
return err
@ -1112,7 +1112,7 @@ func (c *Core) reSendDdMsg(ctx context.Context, force bool) error {
return err
}
ts = ddReq.Base.Timestamp
dbName, collName = ddReq.DbName, ddReq.CollectionName
collName = ddReq.CollectionName
collInfo, err := c.MetaTable.GetCollectionByName(ddReq.CollectionName, 0)
if err != nil {
return err
@ -1129,17 +1129,7 @@ func (c *Core) reSendDdMsg(ctx context.Context, force bool) error {
}
if invalidateCache {
req := proxypb.InvalidateCollMetaCacheRequest{
Base: &commonpb.MsgBase{
MsgType: 0, //TODO, msg type
MsgID: 0, //TODO, msg id
Timestamp: ts,
SourceID: c.session.ServerID,
},
DbName: dbName,
CollectionName: collName,
}
c.proxyClientManager.InvalidateCollectionMetaCache(c.ctx, &req)
c.ExpireMetaCache(ctx, []string{collName}, ts)
}
// Update DDOperation in etcd