apache / apache/pulsar

unclear relation between namespace and cluster name

Open
#11,356 5 comments 0 reactions 0 assignees View on GitHub
lifecycle/stale type/bug
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 14h
Merged PRs (30d)
160

Description

See my console output:

```
[root@server2:~]# pulsar-admin namespaces list pairtime-test
"pairtime-test/projection_akka_journal_nt_cluster_run_7"

[root@server2:~]# pulsar-admin namespaces get-clusters pairtime-test/projection_akka_journal_nt_cluster_run_7
"pulsar-cluster-1"
```

`pulsar-cluster-1` was the cluster name I used in the first deployment, which was changed to `pairtime-test` in later deployments.
Somehow the first name is sticky to namespaces created under that name.

And in the [documentation page](https://pulsar.apache.org/docs/en/pulsar-admin/#get-clusters), it says "replication clusters". It seems all the settings around the cluster name make sense only in a geo-replication setup.

However, the above mismatch cause runtime errors like
```
org.apache.pulsar.client.api.PulsarClientException$BrokerMetadataException: Namespace missing local cluster name in clusters list: local_cluster=nt-test-cluster ns=pairtime-test/projection_akka_journal_nt_cluster_run_7 clusters=[pulsar-cluster-1]
at org.apache.pulsar.client.impl.ClientCnx.getPulsarClientException(ClientCnx.java:1092)
at org.apache.pulsar.client.impl.ClientCnx.handlePartitionResponse(ClientCnx.java:589)
at org.apache.pulsar.common.protocol.PulsarDecoder.channelRead(PulsarDecoder.java:129)
```
In a single cluster setup.

**Posible fix:**

1. Make it very clear what the cluster name means to a namespace, and what operational steps are needed when the user changes the cluster name in a single-cluster setup.
2. Or, handle the above error internally and make it always work in a single-cluster setup.

Contributor guide

Open the contributing guide

Research direction

Start with the pulsar-admin namespaces list and get-clusters commands, the linked get-clusters documentation, and the ClientCnx.java stack trace. Determine how a namespace retains its cluster name and how single-cluster deployments are expected to behave. Done means either the documentation clearly explains the relationship and migration steps, or the reported single-cluster error is handled consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.