massakam opened a new pull request #7735:
URL: https://github.com/apache/pulsar/pull/7735


   ### Motivation
   
   When a topic is unloaded and moved to another broker, the producer for 
geo-replication often remains unclosed. Because of this, geo-replication is not 
possible on the broker to which the topic was moved and messages accumulate in 
the replication backlog.
   
   ```
   18:56:55.166 [pulsar-io-21-6] ERROR o.a.pulsar.client.impl.ProducerImpl  - 
[persistent://xxx/yyy/zzz] [pulsar.repl.dc2] Failed to create producer: 
Producer with name 'pulsar.repl.dc2' is already connected to topic
   ```
   
   When this issue occurs, the following log is output on the broker where the 
topic is unloaded.
   
   ```
   17:14:36.424 [bookkeeper-ml-workers-OrderedExecutor-18-0] INFO  
o.a.p.b.s.persistent.PersistentTopic - [persistent://xxx/yyy/zzz] Un-fencing 
topic...
   ```
   
   Unloaded topics are usually fenced to prevent new clients from connecting. 
In this case, however, the producers reconnected to the topic because it had 
been unfenced, and the replicator was restarted.
   
   I think this is due to https://github.com/apache/pulsar/pull/5271. If a 
topic is fenced to close or delete, we should not unfence it.
   
   ### Modifications
   
   When closing or deleting the `PersistentTopic` instance, set the 
`isClosingOrDeleting` flag to true. If `isClosingOrDeleting` is true, do not 
unfence the topic unless closing or deleting fails.


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