You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2022/11/17 10:37:06 UTC

[inlong] branch master updated: [INLONG-6561][Manager] Fix the InlongGroup cannot be deleted (#6562)

This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 0bee46773 [INLONG-6561][Manager] Fix the InlongGroup cannot be deleted (#6562)
0bee46773 is described below

commit 0bee46773b297ee1f0b0c62972d4a603f2a0b53f
Author: fuweng11 <76...@users.noreply.github.com>
AuthorDate: Thu Nov 17 18:37:00 2022 +0800

    [INLONG-6561][Manager] Fix the InlongGroup cannot be deleted (#6562)
---
 .../inlong/manager/service/group/InlongGroupServiceImpl.java      | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/group/InlongGroupServiceImpl.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/group/InlongGroupServiceImpl.java
index 4a7a7d56d..a96946fc4 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/group/InlongGroupServiceImpl.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/group/InlongGroupServiceImpl.java
@@ -453,6 +453,11 @@ public class InlongGroupServiceImpl implements InlongGroupService {
         InlongGroupEntity entity = groupMapper.selectByGroupId(groupId);
         Preconditions.checkNotNull(entity, ErrorCodeEnum.GROUP_NOT_FOUND.getMessage());
 
+        // before deleting an inlong group, delete all inlong streams, sources, sinks, and other info under it
+        if (GroupStatus.allowedDeleteSubInfos(GroupStatus.forCode(entity.getStatus()))) {
+            streamService.logicDeleteAll(groupId, operator);
+        }
+
         entity.setIsDeleted(entity.getId());
         entity.setStatus(GroupStatus.DELETED.getCode());
         entity.setModifier(operator);
@@ -464,9 +469,6 @@ public class InlongGroupServiceImpl implements InlongGroupService {
 
         // logically delete the associated extension info
         groupExtMapper.logicDeleteAllByGroupId(groupId);
-        if (GroupStatus.allowedDeleteSubInfos(GroupStatus.forCode(entity.getStatus()))) {
-            streamService.logicDeleteAll(groupId, operator);
-        }
 
         LOGGER.info("success to delete group and group ext property for groupId={} by user={}", groupId, operator);
         return true;