diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e064e678884bd90cd363b67629ea8e7466a59cb..973165af1febf06d568f1faadd36a217d514d1bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/core/src/server/delivery/request/CreatePartitionRequest.cpp b/core/src/server/delivery/request/CreatePartitionRequest.cpp index fecd2ff72d782b05f3bec198884364f5d2b40883..a361c0e8ef431213acc389b1c959649ae382b667 100644 --- a/core/src/server/delivery/request/CreatePartitionRequest.cpp +++ b/core/src/server/delivery/request/CreatePartitionRequest.cpp @@ -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, "")); diff --git a/core/src/utils/ValidationUtil.cpp b/core/src/utils/ValidationUtil.cpp index 39dbc5c23bd1d1eeabf1d06acd0073d162ee28a8..0808ca582d7c2f38e45ee93fc929c381f2cd68d6 100644 --- a/core/src/utils/ValidationUtil.cpp +++ b/core/src/utils/ValidationUtil.cpp @@ -422,7 +422,7 @@ ValidationUtil::ValidatePartitionTags(const std::vector& 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