poorbarcode opened a new pull request, #19841:
URL: https://github.com/apache/pulsar/pull/19841
### Motivation
The admin API `getSubscriptions` of `PersistentTopics` works like this:
1. getSubscriptions( `tp1` )
2. is partitioned topic?
`no`: return subscriptions
`yes`:
getSubscriptions(`tp1-partition-0`)....getSubscriptions(`tp1-partition-n`)
If there is a bug that causes the broker to mistake `tp1-partition-n` for
`tp1`, then an infinite loop of calls to `getSubscriptions( tp1 )` occurs(you
can reproduce this issue by the test `testInfiniteHttpCallGetSubscriptions`).
<strong>(Highlight)</strong> This problem will be hit when a topic named
like this `tp1-partition-0-DLQ-partition-0`, see:
https://github.com/apache/pulsar/blob/da788794ebe211bc96d4d961de49ffeeb473ffad/pulsar-common/src/main/java/org/apache/pulsar/common/naming/TopicName.java#L233-L237
### Modifications
Fix the wrong logic of the method `TopicName.getPartition(int index)`
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update
later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository:
- https://github.com/poorbarcode/pulsar/pull/78
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]