Server is not forbidden to create new partition which tag is _default (#1770)

* HasTable with a not exist table name, return error status

Signed-off-by: groot <yihua.mo@zilliz.com>

* Server is not forbidden to create new partition which tag is _default

Signed-off-by: groot <yihua.mo@zilliz.com>
pull/1773/head
groot 2020-03-27 10:00:51 +08:00 committed by GitHub
parent 310d5d70bc
commit e4264d8461
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,7 @@ Please mark all change in change log and use the issue from GitHub
# Milvus 0.8.0 (TBD)
## Bug
- \#1762 Server is not forbidden to create new partition which tag is "_default"
## Feature

View File

@ -47,6 +47,10 @@ CreatePartitionRequest::OnExecute() {
return status;
}
if (tag_ == milvus::engine::DEFAULT_PARTITON_TAG) {
return Status(SERVER_INVALID_PARTITION_TAG, "'_default' is built-in partition tag");
}
status = ValidationUtil::ValidatePartitionTags({tag_});
fiu_do_on("CreatePartitionRequest.OnExecute.invalid_partition_name",
status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));

View File

@ -422,7 +422,7 @@ ValidationUtil::ValidatePartitionTags(const std::vector<std::string>& partition_
if (valid_tag.empty()) {
std::string msg = "Invalid partition tag: " + valid_tag + ". " + "Partition tag should not be empty.";
SERVER_LOG_ERROR << msg;
return Status(SERVER_INVALID_TABLE_NAME, msg);
return Status(SERVER_INVALID_PARTITION_TAG, msg);
}
// max length of partition tag