merlimat commented on code in PR #25304:
URL: https://github.com/apache/pulsar/pull/25304#discussion_r2921332499


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/metrics/AbstractMetrics.java:
##########
@@ -173,7 +173,9 @@ protected String parseNamespaceFromLedgerName(String 
ledgerName) {
         Matcher m = V2_LEDGER_NAME_PATTERN.matcher(ledgerName);
 
         if (m.matches()) {
-            return m.group(1);
+            // Ledger name format: tenant/namespace/domain/topic
+            // Extract only tenant/namespace (groups 2 and 3), excluding the 
domain.
+            return m.group(2) + "/" + m.group(3);

Review Comment:
   done



##########
pulsar-common/src/main/java/org/apache/pulsar/common/naming/TopicName.java:
##########
@@ -133,40 +126,20 @@ 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
-
-
-            parts = Splitter.on("/").limit(4).splitToList(rest);
+            // Expected format: tenant/namespace/<localName>

Review Comment:
   👍 done



-- 
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]

Reply via email to