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/01/12 14:33:59 UTC

[GitHub] [pulsar] aloyszhang opened a new pull request #9193: fix max topic for namespace does not work

aloyszhang opened a new pull request #9193:
URL: https://github.com/apache/pulsar/pull/9193


   ### Motivation
   fix max topic for namespace does not work. 
   "/managed-ledgers" should be access by locakZk instead of globalZk 
   
   
   


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



[GitHub] [pulsar] jiazhai commented on pull request #9193: fix max topic for namespace does not work

Posted by GitBox <gi...@apache.org>.
jiazhai commented on pull request #9193:
URL: https://github.com/apache/pulsar/pull/9193#issuecomment-760116333


   @aloyszhang  opened issue #9207 to track the changes of 2 zk in test base.


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



[GitHub] [pulsar] aloyszhang commented on pull request #9193: fix max topic for namespace does not work

Posted by GitBox <gi...@apache.org>.
aloyszhang commented on pull request #9193:
URL: https://github.com/apache/pulsar/pull/9193#issuecomment-759158359


   /pulsarbot run-failure-checks


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



[GitHub] [pulsar] codelipenghui commented on a change in pull request #9193: fix max topic for namespace does not work

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on a change in pull request #9193:
URL: https://github.com/apache/pulsar/pull/9193#discussion_r556221541



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
##########
@@ -812,7 +812,7 @@ protected boolean isNamespaceReplicated(NamespaceName namespaceName) {
         try {
             String topicPartitionPath = joinPath(MANAGED_LEDGER_PATH_ZNODE,
                     namespaceName.toString(), topicDomain.value());
-            List<String> topics = globalZk().getChildren(topicPartitionPath, false);
+            List<String> topics = localZk().getChildren(topicPartitionPath, false);

Review comment:
       Is it possible to add a unit test? This will make pulsar more robust




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



[GitHub] [pulsar] jiazhai commented on a change in pull request #9193: fix max topic for namespace does not work

Posted by GitBox <gi...@apache.org>.
jiazhai commented on a change in pull request #9193:
URL: https://github.com/apache/pulsar/pull/9193#discussion_r556918579



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
##########
@@ -812,7 +812,7 @@ protected boolean isNamespaceReplicated(NamespaceName namespaceName) {
         try {
             String topicPartitionPath = joinPath(MANAGED_LEDGER_PATH_ZNODE,
                     namespaceName.toString(), topicDomain.value());
-            List<String> topics = globalZk().getChildren(topicPartitionPath, false);
+            List<String> topics = localZk().getChildren(topicPartitionPath, false);

Review comment:
       Thanks @aloyszhang , This change lgtm. As @codelipenghui mentioned, it would be great if we have it reproduced and fixed in the unit test.  
   How about we create 2 mocked zk in the `MockedPulsarServiceBaseTest`, 1 zk for localZk() and another for globalZk? By this way, we could reproduce this error in the original code, and verify it fixed by this change.




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



[GitHub] [pulsar] aloyszhang commented on pull request #9193: fix max topic for namespace does not work

Posted by GitBox <gi...@apache.org>.
aloyszhang commented on pull request #9193:
URL: https://github.com/apache/pulsar/pull/9193#issuecomment-758798795


   /pulsarbot run-failure-checks


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



[GitHub] [pulsar] jiazhai merged pull request #9193: fix max topic for namespace does not work

Posted by GitBox <gi...@apache.org>.
jiazhai merged pull request #9193:
URL: https://github.com/apache/pulsar/pull/9193


   


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



[GitHub] [pulsar] aloyszhang commented on a change in pull request #9193: fix max topic for namespace does not work

Posted by GitBox <gi...@apache.org>.
aloyszhang commented on a change in pull request #9193:
URL: https://github.com/apache/pulsar/pull/9193#discussion_r556222407



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
##########
@@ -812,7 +812,7 @@ protected boolean isNamespaceReplicated(NamespaceName namespaceName) {
         try {
             String topicPartitionPath = joinPath(MANAGED_LEDGER_PATH_ZNODE,
                     namespaceName.toString(), topicDomain.value());
-            List<String> topics = globalZk().getChildren(topicPartitionPath, false);
+            List<String> topics = localZk().getChildren(topicPartitionPath, false);

Review comment:
       There is  already has a test `AdminApiTest2#testMaxTopicsPerNamespace`




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



[GitHub] [pulsar] aloyszhang commented on pull request #9193: fix max topic for namespace does not work

Posted by GitBox <gi...@apache.org>.
aloyszhang commented on pull request #9193:
URL: https://github.com/apache/pulsar/pull/9193#issuecomment-759097788


   /pulsarbot run-failure-checks


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



[GitHub] [pulsar] aloyszhang commented on a change in pull request #9193: fix max topic for namespace does not work

Posted by GitBox <gi...@apache.org>.
aloyszhang commented on a change in pull request #9193:
URL: https://github.com/apache/pulsar/pull/9193#discussion_r556995964



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
##########
@@ -812,7 +812,7 @@ protected boolean isNamespaceReplicated(NamespaceName namespaceName) {
         try {
             String topicPartitionPath = joinPath(MANAGED_LEDGER_PATH_ZNODE,
                     namespaceName.toString(), topicDomain.value());
-            List<String> topics = globalZk().getChildren(topicPartitionPath, false);
+            List<String> topics = localZk().getChildren(topicPartitionPath, false);

Review comment:
       Thanks for your suggestion @jiazhai @codelipenghui .
   I have test the `AdminApiTest2#testMaxTopicsPerNamespace` and found the globalZk and localZk return the same result , this is why the original test passed.
   I'll try to add two different zk for local and global respectively.




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



[GitHub] [pulsar] aloyszhang commented on a change in pull request #9193: fix max topic for namespace does not work

Posted by GitBox <gi...@apache.org>.
aloyszhang commented on a change in pull request #9193:
URL: https://github.com/apache/pulsar/pull/9193#discussion_r556222407



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
##########
@@ -812,7 +812,7 @@ protected boolean isNamespaceReplicated(NamespaceName namespaceName) {
         try {
             String topicPartitionPath = joinPath(MANAGED_LEDGER_PATH_ZNODE,
                     namespaceName.toString(), topicDomain.value());
-            List<String> topics = globalZk().getChildren(topicPartitionPath, false);
+            List<String> topics = localZk().getChildren(topicPartitionPath, false);

Review comment:
       There is  already a test `AdminApiTest2#testMaxTopicsPerNamespace`




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



[GitHub] [pulsar] aloyszhang commented on a change in pull request #9193: fix max topic for namespace does not work

Posted by GitBox <gi...@apache.org>.
aloyszhang commented on a change in pull request #9193:
URL: https://github.com/apache/pulsar/pull/9193#discussion_r556995964



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
##########
@@ -812,7 +812,7 @@ protected boolean isNamespaceReplicated(NamespaceName namespaceName) {
         try {
             String topicPartitionPath = joinPath(MANAGED_LEDGER_PATH_ZNODE,
                     namespaceName.toString(), topicDomain.value());
-            List<String> topics = globalZk().getChildren(topicPartitionPath, false);
+            List<String> topics = localZk().getChildren(topicPartitionPath, false);

Review comment:
       Thanks for yours suggestion @jiazhai @codelipenghui .
   I have test the `AdminApiTest2#testMaxTopicsPerNamespace` and found the globalZk and localZk return the same result , this is why the original test passed.
   I'll try to add two different zk for local and global respectively.




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