Don't expose index params when error occurred (#20187)

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
pull/20200/head
cai.zhang 2022-10-31 12:11:33 +08:00 committed by GitHub
parent 2ff21f0e10
commit 61775122ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -450,9 +450,10 @@ func (mt *metaTable) CanCreateIndex(req *indexpb.CreateIndexRequest) (bool, erro
if mt.checkParams(index, req) {
return true, nil
}
errMsg := fmt.Sprintf("index already exist, but parameters are inconsistent. source index: %v current index: %v",
fmt.Sprintf("{index_name: %s, field_id: %d, index_params: %v, type_params: %v}", index.IndexName, index.FieldID, index.IndexParams, index.TypeParams),
fmt.Sprintf("{index_name: %s, field_id: %d, index_params: %v, type_params: %v}", req.GetIndexName(), req.GetFieldID(), req.GetIndexParams(), req.GetTypeParams()))
errMsg := "at most one distinct index is allowed per field"
log.Warn(errMsg,
zap.String("source index", fmt.Sprintf("{index_name: %s, field_id: %d, index_params: %v, type_params: %v}", index.IndexName, index.FieldID, index.IndexParams, index.TypeParams)),
zap.String("current index", fmt.Sprintf("{index_name: %s, field_id: %d, index_params: %v, type_params: %v}", req.GetIndexName(), req.GetFieldID(), req.GetIndexParams(), req.GetTypeParams())))
return false, fmt.Errorf("CreateIndex failed: %s", errMsg)
}
if req.FieldID == index.FieldID {

View File

@ -6,7 +6,7 @@ from check.func_check import ResponseChecker
from utils.api_request import api_request
TIMEOUT = 20
INDEX_NAME = "_default_idx"
INDEX_NAME = ""
class ApiIndexWrapper: