[Bug] pulsar-admin log showed http 412 error when split bundle
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
### Search before asking
- [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 don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.
### Version
Pulsar Version:4.0.2
OS version:AlmaLinux release 9.2 (Turquoise Kodkod)
Kubernetes Version: v1.30.0
### Minimal reproduce step
when I split bundle with pulsar-admin, the puladmin log show: "Failed to perform http put request: javax.ws.rs.ClientErrorException: HTTP 412 {"reason":"Cannot find bundle in the bundles list"} "
```
pulsar-toolset-0:/pulsar$ bin/pulsar-admin namespaces bundles public/default
{
"boundaries" : [ "0x00000000", "0x10000000", "0x20000000", "0x30000000", "0x40000000", "0x50000000", "0x60000000", "0x70000000", "0x80000000", "0x90000000", "0xa0000000", "0xb0000000", "0xc0000000", "0xd0000000", "0xe0000000", "0xf0000000", "0xffffffff" ],
"numBundles" : 16
}
pulsar-toolset-0:/pulsar$ bin/pulsar-admin namespaces split-bundle --bundle 0x70000000 public/default
2025-03-28T11:08:31,201+0000 [AsyncHttpClient-7-1] WARN org.apache.pulsar.client.admin.internal.BaseResource - [http://pulsar-proxy:80/admin/v2/namespaces/public/default/0x70000000/split?unload=false] Failed to perform http put request: javax.ws.rs.ClientErrorException: HTTP 412 {"reason":"Invalid bundle range: 0x70000000"}
Invalid bundle range: 0x70000000
pulsar-toolset-0:/pulsar$ bin/pulsar-admin namespaces split-bundle --bundle 0x7000000_0xa0000000 public/default
2025-03-28T11:12:36,238+0000 [AsyncHttpClient-7-1] WARN org.apache.pulsar.client.admin.internal.BaseResource - [http://pulsar-proxy:80/admin/v2/namespaces/public/default/0x7000000_0xa0000000/split?unload=false] Failed to perform http put request: javax.ws.rs.ClientErrorException: HTTP 412 {"reason":"Cannot find bundle in the bundles list"}
Cannot find bundle in the bundles list
Reason: Cannot find bundle in the bundles list
```
### What did you expect to see?
I expect I can refer to the following article to split the bundle
https://pulsar.apache.org/docs/4.0.x/concepts-broker-load-balancing-quick-start/#configure-broker-load-balancer-to-run-manually
### What did you see instead?
bin/pulsar-admin namespaces split-bundle --bundle 0x70000000 public/default
2025-03-28T11:08:31,201+0000 [AsyncHttpClient-7-1] WARN org.apache.pulsar.client.admin.internal.BaseResource - [http://pulsar-proxy:80/admin/v2/namespaces/public/default/0x70000000/split?unload=false] Failed to perform http put request: javax.ws.rs.ClientErrorException: HTTP 412 {"reason":"Invalid bundle range: 0x70000000"}
Invalid bundle range: 0x70000000
Reason: Invalid bundle range: 0x70000000
### Anything else?
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Contributor guide
Research direction
Start by reproducing the issue with the documented `pulsar-admin namespaces split-bundle` commands against the `public/default` namespace and compare the generated admin request with the bundle boundaries returned by `namespaces bundles`. Trace the split-bundle CLI entry point and the `/admin/v2/namespaces/.../split` endpoint; done means a valid bundle can be split without HTTP 412 errors and invalid ranges remain clearly rejected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kubernetes
- Domain
- backend, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100