mikecaat opened a new issue #7512:
URL: https://github.com/apache/pulsar/issues/7512


   **Describe the bug**
   If the replicator-dispatch-rate is not configured, the geo-replication 
policy is not be updated.
   
   **To Reproduce**
   1. make three pulsar clusters(cluster-a,cluster-b,cluster-c).
   2. make a namespace with two cluster(cluster-a,cluster-b).
   ```
   bin/pulsar-admin namespaces set-clusters my-tenant/my-namespace --clusters 
cluster-a,cluster-b
   ```
   3. produce messages to cluster-a until this reproduce procedure is end.
   ```
   bin/pulsar-perf produce -r 1 -n 1 -s 10 
persistent://my-tenant/my-namespace/topic
   ```
   4. check the topic stats
   The replication attribute has only cluster-b.
   ```
   bin/pulsar-admin persistent stats persistent://my-tenant/my-namespace/topic
   ```
   5. change the namespace policy to replicate **all** clusters.
   ```
   bin/pulsar-admin namespaces set-clusters my-tenant/my-namespace --clusters 
cluster-a,cluster-b,cluster-c
   ```
   6. check the topic stats
   The replication attribute has **only cluster-b even though cluster-c is 
added to the namespace**.
   ```
   bin/pulsar-admin persistent stats persistent://my-tenant/my-namespace/topic
   ```
   
   **Expected behavior**
   When execute the above 6, my excepted is that the replication attribute have 
cluster-b and cluster-c.
   We want to change the replication policy dynamically without deleting the 
topic, don't you?
   
   If I change the replicator-dispatch-rate when the above 2, above 6 shows the 
expected result which the replication attribute has cluster-b and cluster-c.
   ```
   bin/pulsar-admin namespaces set-clusters my-tenant/my-namespace --clusters 
cluster-a,cluster-b
   bin/pulsar-admin namespaces set-replicator-dispatch-rate 
my-tenant/my-namespace \
     --msg-dispatch-rate 1000 \
     --byte-dispatch-rate 1048576 \
     --dispatch-rate-period 1
   ```
   
   **Desktop (please complete the following information):**
    - OS: ubuntu 20.04
   
   **Additional context**
   I think there is the function to change replication policy dynamically.
   
https://github.com/apache/pulsar/blob/4916acdc237420807b5242aed9e04f6b6034db8e/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java#L1772
   
   But, If replicator-dispatch-rate is not configured, 
java.util.NoSuchElemetnException is occured on the following code.
   
https://github.com/apache/pulsar/blob/4916acdc237420807b5242aed9e04f6b6034db8e/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java#L1807
   
   If this behavior is expected, I think it's better to document it.
   I can't find those on https://pulsar.apache.org/docs/en/administration-geo/.
   
   Regards,


----------------------------------------------------------------
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:
[email protected]


Reply via email to