Hello everyone.

I would like to start the vote for PIP-242 
https://github.com/apache/pulsar/issues/19239,
Please let me know if you have any concerns or questions.

Best,
Mattison

------- Paste original PIP content to help quote ------

### Motivation

Currently, the Apache Pulsar broker allows users to create a topic name that 
includes `-partition-`, which is confusing for our developers to identify 
whether this is a partition of a partitioned topic. Plus, we need to add more 
logic to be compatible with this special topic name. for example:

- https://github.com/apache/pulsar/pull/19240
- https://github.com/apache/pulsar/pull/19230
- https://github.com/apache/pulsar/pull/19171
- https://github.com/apache/pulsar/pull/19086
- ...

### Goal
This proposal wants `-partition-` to be a topic name keyword. Users can only 
create a topic with it if the topic is partitioned. For the compatibility 
reason, we want to Introduce a new configuration - `enableStrictTopicName` for 
the broker to help reject creating a topic in the following cases:
1. Create a partitioned topic that includes `-partition-`.
2. Create a topic which is not a partitioned topic.

**Create a topic:**
_no corresponding partitioned topic_

- persistent://public/default/local-name (passed)
- persistent://public/default/local-name-partition-z (rejected by keyword)
- persistent://public/default/local-name-partition-0 (rejected by keyword)

_Has corresponding partitioned topic, **partitions=2** and topic partition name 
is **persistent://public/default/local-name**_

- persistent://public/default/local-name-partition-0 (passed, Because it is the 
partition topic's sub-partition)
- persistent://public/default/local-name-partition-z (rejected by keyword)
- persistent://public/default/local-name-partition-4 (rejected, Because it 
exceeds the number of maximum partitions)

**Create a partitioned topic(topic metadata)**

- persistent://public/default/local-name (passed)
- persistent://public/default/local-name-partition-z (rejected by keyword)
- persistent://public/default/local-name-partition-0 (rejected by keyword)


### API Changes

Add a new configuration, `enableStrictTopicName=false`.

### Implementation

1. Add configuration `enableStrictTopicName=false`.
2. Add rejection logic when the user enables `enableStrictTopicName`.
4. Add warning logs to inform users that we do not recommend creating 
non-partitioned topics with the keyword `-partition-`.
5. Make `enableStrictTopicName=true` in the next major release.

Reply via email to