You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.
Currently, the Apache Pulsar has no restrictions on the topic name. For example, we allowed users to create topic with -partition- keyword, 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:
This proposal aimed to add more restrictions for a topic name. that includes three parts as follows:
Using NamedEntity to validate the topic name characters.
Make the -partition- string the keyword. That allows the user to use it when it's 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)
Compatibility
We will introduce the new configuration strictTopicNameEnabled to support compatibility. Users can easily disable it to get rid of the restrictions.
API Changes
Add a new configuration, strictTopicNameEnabled=false.
Implementation
Add configuration strictTopicNameEnabled=false and make it dynamic.
Add topic name validation by NamedEntity
Add partitioned topic rejection logic.
Add warning logs to inform users that we do not recommend creating topics that name with the restrictions name when users disable enableStrictTopicName.
Make strictTopicNameEnabled=true in the next major release. and mark that this config will be removed in the future.
The text was updated successfully, but these errors were encountered:
sijie
changed the title
ISSUE-19239: [WIP]PIP-242: Introduce enableStrictMode to reject creating topic with -partition- keyword.
ISSUE-19239: PIP-242: Topic name restrictions
Mar 24, 2023
Original Issue: apache#19239
Motivation
Currently, the Apache Pulsar has no restrictions on the topic name. For example, we allowed users to create topic with
-partition-
keyword, 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:-partition-
(#19230) apache/pulsar#19240-partition-
apache/pulsar#19230-partition-
but no metadata apache/pulsar#19171Goal
This proposal aimed to add more restrictions for a topic name. that includes three parts as follows:
NamedEntity
to validate the topic name characters.-partition-
string the keyword. That allows the user to use it when it's a partitioned topic.Create a topic:
no corresponding partitioned topic
Has corresponding partitioned topic, partitions=2 and topic partition name is persistent://public/default/local-name
Create a partitioned topic(topic metadata)
Compatibility
We will introduce the new configuration
strictTopicNameEnabled
to support compatibility. Users can easily disable it to get rid of the restrictions.API Changes
Add a new configuration,
strictTopicNameEnabled=false
.Implementation
strictTopicNameEnabled=false
and make it dynamic.NamedEntity
enableStrictTopicName
.strictTopicNameEnabled=true
in the next major release. and mark that this config will be removed in the future.The text was updated successfully, but these errors were encountered: