From fcdb316e23d9e06e65595c71ce4acba03e3d08ea Mon Sep 17 00:00:00 2001 From: ggbocoder <1832877748@qq.com> Date: Thu, 22 Aug 2024 00:20:54 +0800 Subject: [PATCH] fix --- .../apache/seata/namingserver/manager/NamingManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java b/namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java index 69dd61f828d..fde7640286e 100644 --- a/namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java +++ b/namingserver/src/main/java/org/apache/seata/namingserver/manager/NamingManager.java @@ -177,7 +177,9 @@ public Result createGroup(String namespace, String vGroup, String cluste public Result removeGroup(String namespace, String clusterName,String vGroup, String unitName) { List clusterList = getClusterListByVgroup(vGroup, namespace); for (Cluster cluster : clusterList) { - if (!StringUtils.equals(clusterName, cluster.getClusterName())) continue; + if (!StringUtils.equals(clusterName, cluster.getClusterName())) { + continue; + } if (cluster.getUnitData() != null && cluster.getUnitData().size() > 0) { Unit unit = cluster.getUnitData().get(0); if (unit != null && unit.getNamingInstanceList() != null && unit.getNamingInstanceList().size() > 0) { @@ -282,7 +284,7 @@ public boolean unregisterInstance(String namespace, String clusterName, String u Object vgroupMap = node.getMetadata().get(CONSTANT_GROUP); if (vgroupMap instanceof Map) { ((Map) vgroupMap).forEach((group, realUnitName) -> vGroupMap.get(group, k -> new ConcurrentHashMap<>()) - .get(namespace).getCluster(clusterName).remove(realUnitName == null ? unitName : realUnitName)); + .get(namespace).getCluster(clusterName).remove(realUnitName == null ? unitName : (String) realUnitName)); } notifyClusterChange(namespace, clusterName, unitName, node.getTerm()); instanceLiveTable.remove(