apache / apache/pulsar

[Bug] Replication clusters cannot be cleared for a namespace

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

Description

### Search before reporting

- [x] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.

### Read release policy

- [x] I understand that [unsupported versions](https://pulsar.apache.org/contribute/release-policy/#supported-versions) don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

### User environment

Pulsar 4.0.5

### Issue Description

Apache Pulsar allows replication clusters to be set at the namespace level. This means every topic in a namespace gets replicated as configured.

To date there is no way to disable replication at the namespace level. If an empty list of clusters is passed in, Pulsar returns an error:

```
curl -XPOST https://:CLUSTER_ENDPOINT/admin/v2/:TENANT/:NS/:TOPIC/replication -D '[]'
{"reason":"ClusterIds should not be null or empty"}
```

The expectation is for this to disable replication.

### Error messages

```text
{"reason":"ClusterIds should not be null or empty"}
```

### Reproducing the issue

Apache Pulsar allows replication clusters to be set at the namespace level. This means every topic in a namespace gets replicated as configured.

To date there is no way to disable replication at the namespace level. If an empty list of clusters is passed in, Pulsar returns an error:

```
curl -XPOST https://:CLUSTER_ENDPOINT/admin/v2/:TENANT/:NS/:TOPIC/replication -D '[]'
{"reason":"ClusterIds should not be null or empty"}
```

The expectation is for this to disable replication.

### Additional information

_No response_

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the namespace replication request against Pulsar 4.0.5 using the documented admin endpoint and an empty cluster list. Trace that endpoint's validation and verify that an empty list disables namespace-level replication without returning the current error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.