pulsar-perf: improve error message when trying to run a transaction on a non-transactional broker.
- 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.
### Motivation
Using the `pulsar-perf transaction` command to run a transactional request on a broker with no transaction coordinator returns a java stack trace.
```
org.apache.pulsar.client.api.PulsarClientException$AuthorizationException: {"errorMsg":"{"errorMsg":"Proxy Client is not authorized to Get Partition Metadata","reqId":337688082440527175, "remote":"pulsar-server/10.0.74.164:6650", "local":"/10.240.1.120:59482"}","reqId":4043271315455241786, "remote":"pulsar-server/40.91.75.49:6651", "local":"/10.240.2.1:37198"}
```
This appears to be an authorization error, so the solution to enable the transaction coordinator is not obvious.
### Solution
pulsar-perf (and possibly pulsar-client) should return an error that clearly states that it's not possible to run a transaction when the transaction coordinator is disabled.
### Alternatives
_No response_
### Anything else?
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Contributor guide
Research direction
Start with the pulsar-perf transaction command and trace how a request fails when the broker has no transaction coordinator. Reproduce the authorization-style stack trace against a non-transactional broker, then identify the client or command boundary where the failure can be reported clearly. Done means the command explains that transactions cannot run while the transaction coordinator is disabled, with coverage for this scenario.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- cli, distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100