woofyzhao commented on code in PR #4955:
URL: https://github.com/apache/inlong/pull/4955#discussion_r917679220
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterServiceImpl.java:
##########
@@ -169,42 +169,41 @@ public Boolean updateTag(ClusterTagRequest request,
String operator) {
LOGGER.warn("inlong cluster tag was not exist for id={}", id);
return true;
}
- InlongClusterTagEntity tagExist =
clusterTagMapper.selectByTag(newClusterTag);
- if (tagExist != null) {
- String errMsg = String.format("inlong cluster tag [%s] already
exist", newClusterTag);
- LOGGER.error(errMsg);
- throw new BusinessException(errMsg);
- }
- // check if there are some InlongGroups that uses this tag
String oldClusterTag = exist.getClusterTag();
- this.assertNoInlongGroupExists(oldClusterTag);
+ if (!newClusterTag.equals(oldClusterTag)) {
+ InlongClusterTagEntity tagConflict =
clusterTagMapper.selectByTag(newClusterTag);
+ if (tagConflict != null) {
+ String errMsg = String.format("inlong cluster tag [%s] already
exist by id [%d]", newClusterTag,
Review Comment:
The id here is the other name-conflicting tag entity id, not the one passed
from client.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]