You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/06/10 03:16:53 UTC

[GitHub] [pulsar] 315157973 commented on a change in pull request #10850: maxTopicsPerNamespace check should exclude system topic.

315157973 commented on a change in pull request #10850:
URL: https://github.com/apache/pulsar/pull/10850#discussion_r648819655



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/systopic/SystemTopicClient.java
##########
@@ -168,12 +172,19 @@
     }
 
     static boolean isSystemTopic(TopicName topicName) {
-        if (topicName.isPartitioned()) {
-            return EventsTopicNames.NAMESPACE_EVENTS_LOCAL_NAME
-                    .equals(TopicName.get(topicName.getPartitionedTopicName()).getLocalName());
+        if (Objects.equal(SYSTEM_NAMESPACE, topicName.getNamespaceObject())) {
+            return true;
         }
+        String localName = TopicName.get(topicName.getPartitionedTopicName()).getLocalName();
+        if (StringUtils.equals(localName, EventsTopicNames.NAMESPACE_EVENTS_LOCAL_NAME) || StringUtils
+                .equals(localName, EventsTopicNames.TRANSACTION_BUFFER_SNAPSHOT) || (
+                StringUtils.startsWith(localName, EventsTopicNames.TRANSACTION_BUFFER_SNAPSHOT) && StringUtils
+                        .endsWith(localName, MLPendingAckStore.PENDING_ACK_STORE_SUFFIX))) {

Review comment:
       This does not seem to be a good way. Whenever a new SystemTopic is added, it must be changed here.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org