Tenant disappered in dashborad if a namespace under this tenant is failed to getTopicsList
To Reproduce
- There is a pulsar instance contains two cluster c1 and c2, a tenant t1 with allowed_cluster=[c1, c2]. Create namespace t1/ns1 in cluster c1, t1/ns2 in cluster c2.
- Configure pulsar manager with cluster_url of c1, t1 won't appear in pulsar manager's dashboard, since the
Getrequest/admin/v2/t1/ns2/topicssent to cluster c1 would fail.
There is related error log in backend:
2020-09-29 17:15:49.617 INFO 109028 --- [http-nio-7750-exec-7] o.a.p.manager.zuul.EnvironmentForward : Forward request to http://pulsar-sz-formal-2.local.sng:8080 @ path /admin/v2/tenants/abies
2020-09-29 17:15:49.680 ERROR 109028 --- [http-nio-7750-exec-9] o.a.p.m.service.impl.TopicsServiceImpl : Failed to get topic list.
org.apache.pulsar.client.admin.PulsarAdminException$PreconditionFailedException: Namespace missing local cluster name in clusters list: local_cluster=pulsar-sz-formal-2 ns=abies/shanghai clusters=[pulsar-sh-formal-2]
Expected behavior
t1 and ns1 should be displayed in dashborad for cluster c1 environment
Related Code
main/java/org/apache/pulsar/manager/service/impl/NamespacesServiceImpl.java
In function public Map<String, Object> getNamespaceList(Integer pageNum, Integer pageSize, String tenant, String requestHost),
there is a loop to query topics list for all namespace
for (String tenantNamespace : namespacesList) {
...
Map<String, Object> topics = topicsService.getTopicsList(0, 0, tenant, namespace, requestHost);
...
}
maybe we should catch expection to tolerate getTopicsList fail for some namespaces?
@Red-Night-Aria It seems that you have found the issue. Are you interested in contributing a fix for it?
@Red-Night-Aria It seems that you have found the issue. Are you interested in contributing a fix for it?
OK, I'll try in my free time