mirror of https://github.com/milvus-io/milvus.git
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
parent
2ff21f0e10
commit
61775122ea
|
@ -450,9 +450,10 @@ func (mt *metaTable) CanCreateIndex(req *indexpb.CreateIndexRequest) (bool, erro
|
||||||
if mt.checkParams(index, req) {
|
if mt.checkParams(index, req) {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
errMsg := fmt.Sprintf("index already exist, but parameters are inconsistent. source index: %v current index: %v",
|
errMsg := "at most one distinct index is allowed per field"
|
||||||
fmt.Sprintf("{index_name: %s, field_id: %d, index_params: %v, type_params: %v}", index.IndexName, index.FieldID, index.IndexParams, index.TypeParams),
|
log.Warn(errMsg,
|
||||||
fmt.Sprintf("{index_name: %s, field_id: %d, index_params: %v, type_params: %v}", req.GetIndexName(), req.GetFieldID(), req.GetIndexParams(), req.GetTypeParams()))
|
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)
|
return false, fmt.Errorf("CreateIndex failed: %s", errMsg)
|
||||||
}
|
}
|
||||||
if req.FieldID == index.FieldID {
|
if req.FieldID == index.FieldID {
|
||||||
|
|
|
@ -6,7 +6,7 @@ from check.func_check import ResponseChecker
|
||||||
from utils.api_request import api_request
|
from utils.api_request import api_request
|
||||||
|
|
||||||
TIMEOUT = 20
|
TIMEOUT = 20
|
||||||
INDEX_NAME = "_default_idx"
|
INDEX_NAME = ""
|
||||||
|
|
||||||
|
|
||||||
class ApiIndexWrapper:
|
class ApiIndexWrapper:
|
||||||
|
|
Loading…
Reference in New Issue