Remove load collection check in Proxy (#18166)

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
pull/18183/head
bigsheeper 2022-07-08 16:12:25 +08:00 committed by GitHub
parent ecc250c20e
commit 0fb5e9c1a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 29 deletions

View File

@ -1172,18 +1172,6 @@ func TestProxy(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, commonpb.ErrorCode_Success, resp.ErrorCode)
// load the same collection, test loaded check
colInfo, err := globalMetaCache.GetCollectionInfo(ctx, collectionName)
assert.NoError(t, err)
colInfo.isLoaded = true
resp, err = proxy.LoadCollection(ctx, &milvuspb.LoadCollectionRequest{
Base: nil,
DbName: dbName,
CollectionName: collectionName,
})
assert.NoError(t, err)
assert.Equal(t, commonpb.ErrorCode_Success, resp.ErrorCode)
// load other collection -> fail
resp, err = proxy.LoadCollection(ctx, &milvuspb.LoadCollectionRequest{
Base: nil,

View File

@ -2591,23 +2591,6 @@ func (lct *loadCollectionTask) Execute(ctx context.Context) (err error) {
return err
}
// check if loaded
info, err := globalMetaCache.GetCollectionInfo(ctx, lct.CollectionName)
if err != nil {
return fmt.Errorf("GetCollectionInfo failed, collection = %s, err = %s", lct.CollectionName, err)
}
if info.isLoaded { // TODO: may not be thread safe
log.Debug("collection has been loaded",
zap.String("role", typeutil.ProxyRole),
zap.String("collectionName", lct.CollectionName),
zap.Int64("collectionID", collID),
zap.Int64("msgID", lct.GetBase().GetMsgID()))
lct.result = &commonpb.Status{
ErrorCode: commonpb.ErrorCode_Success,
}
return nil
}
lct.collectionID = collID
collSchema, err := globalMetaCache.GetCollectionSchema(ctx, lct.CollectionName)
if err != nil {