apache / apache/pulsar-manager

Tenant disappered in dashborad if a namespace under this tenant is failed to getTopicsList

Open
#344 3 comments 0 reactions 0 assignees View on GitHub
triage/week-43 type/bug
Dominant language
Vue
Stars
539
Forks
239
PR merge metrics
No merged PRs in 30d

Description

**To Reproduce**
1. 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.
2. Configure pulsar manager with cluster_url of c1, t1 won't appear in pulsar manager's dashboard, since the `Get` request `/admin/v2/t1/ns2/topics` sent 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 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 topics = topicsService.getTopicsList(0, 0, tenant, namespace, requestHost);
...
}
```

maybe we should catch expection to tolerate `getTopicsList` fail for some namespaces?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.