提交 00723403 编写于 作者: N nobodyiam

fix the situation when some public app namespace is deleted and recreated in another app

上级 59660027
......@@ -131,6 +131,12 @@ public class AppNamespaceService {
List<Cluster> clusters = clusterService.findParentClusters(appId);
for (Cluster cluster : clusters) {
// in case there is some dirty data, e.g. public namespace deleted in other app and now created in this app
if (!namespaceService.isNamespaceUnique(appId, cluster.getName(), namespaceName)) {
continue;
}
Namespace namespace = new Namespace();
namespace.setClusterName(cluster.getName());
namespace.setAppId(appId);
......
......@@ -247,7 +247,11 @@ public class AppNamespaceServiceWithCache implements InitializingBean {
}
appNamespaceCache.remove(assembleAppNamespaceKey(deleted));
if (deleted.isPublic()) {
publicAppNamespaceCache.remove(deleted.getName());
AppNamespace publicAppNamespace = publicAppNamespaceCache.get(deleted.getName());
// in case there is some dirty data, e.g. public namespace deleted in some app and now created in another app
if (publicAppNamespace == deleted) {
publicAppNamespaceCache.remove(deleted.getName());
}
}
logger.info("Found AppNamespace deleted, {}", deleted);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册