shibd commented on code in PR #25304:
URL: https://github.com/apache/pulsar/pull/25304#discussion_r2923388521
##########
pulsar-common/src/main/java/org/apache/pulsar/common/naming/TopicName.java:
##########
@@ -133,40 +126,25 @@ private TopicName(String completeTopicName) {
}
}
- // The fully qualified topic name can be in two different forms:
- // new: persistent://tenant/namespace/topic
- // legacy: persistent://tenant/cluster/namespace/topic
-
+ // Expected format: persistent://tenant/namespace/topic
List<String> parts =
Splitter.on("://").limit(2).splitToList(completeTopicName);
this.domain = TopicDomain.getEnum(parts.get(0));
String rest = parts.get(1);
- // The rest of the name can be in different forms:
- // new: tenant/namespace/<localName>
- // legacy: tenant/cluster/namespace/<localName>
- // Examples of localName:
- // 1. some, name, xyz
- // 2. xyz-123, feeder-2
-
-
+ // Expected format: tenant/namespace/<localName>
parts = Splitter.on("/").limit(4).splitToList(rest);
- if (parts.size() == 3) {
- // New topic name without cluster name
+ if (parts.size() == 4) {
Review Comment:
This rejects any 4-segment V2 topic path, but Pulsar still allows `/` inside
the local topic name. For example, `persistent://tenant/ns/a/b` is a valid V2
topic today and should be parsed as tenant=`tenant`, namespace=`ns`,
localName=`a/b`, not rejected as a V1 name. Could we keep rejecting the real V1
form while still allowing slashes in the local name?
--
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]