poorbarcode opened a new pull request, #22854: URL: https://github.com/apache/pulsar/pull/22854
### Motivation #### Background **1.Regarding the API getting topics by regexp pattern, there are two implementations:*** - `List<String> HttpLookupService.getPartitionedTopicMetadata(...)` - `CommandGetTopicsOfNamespace BinaryProtoLookupService.getPartitionedTopicMetadata(...)` Pulsar transferred both response types `List<String>` and `CommandGetTopicsOfNamespace` to a `GetTopicsResult` object. And discarded the partition information when doing transference. For example: - Get a list `topic-1-partition-0`, `topic-1-partition-1`. - The transferring operation will group them to `topic-1`. **2.The behavior of Patten consumers** - Before https://github.com/apache/pulsar/pull/5230, Patten consumers will try to create the missing partitions when it starts up. - After https://github.com/apache/pulsar/pull/5230, Patten consumers only subscribe to the partitions that exist to lead the topics can be deleted automatically. In other words, it sets the variable `createTopicIfDoesNotExist` of Multi Topics Consumer to `false`. --- #### Issue 1. When users are starting a Pattern consumer, the consumer will try to subscribe to all the partitions even if some partitions have been deleted before, and then the client crashes due to a Topic Not Exists Exception. You can reproduce the issue by the test [testConsumerAfterOnePartDeleted](https://github.com/poorbarcode/pulsar/pull/91/files#diff-c6bb7cf6a6d6f5c4673ec5837351d981c835024fbbb864f32113c05b8ab30b4eR142) 2. The Patten consumer that is started removes all partitions when one partition was deleted, even if there are still half of the partitions exist. --- ### Modifications - Multi Topics Consumer only subscribes to the existing partitions if the config `createTopicIfDoesNotExist` is `false`. - The Patten consumer that is started only removes the partitions that were deleted. ### 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: x -- 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]
