liangyepianzhou commented on code in PR #15296:
URL: https://github.com/apache/pulsar/pull/15296#discussion_r857543709


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/TransactionsBase.java:
##########
@@ -432,4 +434,35 @@ protected void validateTopicName(String property, String 
namespace, String encod
             throw new RestException(Response.Status.PRECONDITION_FAILED, 
"Topic name is not valid");
         }
     }
+
+    protected void internalScaleTransactionCoordinators(int replicas, boolean 
authoritative) {
+        final int maxPartitions = 
pulsar().getConfig().getMaxNumPartitionsPerPartitionedTopic();
+        if (maxPartitions > 0 && replicas > maxPartitions) {
+            throw new RestException(Response.Status.NOT_ACCEPTABLE,
+                    "Number of partitions should be less than or equal to " + 
maxPartitions);
+        }
+        
validateTopicOwnership(SystemTopicNames.TRANSACTION_COORDINATOR_ASSIGN, 
authoritative);

Review Comment:
   This is for authentication, just like `internalUpdatePartitionedTopic` in 
`PersistentTopicsBase`.
   It should be sync.



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