poorbarcode commented on PR #23011:
URL: https://github.com/apache/pulsar/pull/23011#issuecomment-2214446269

   @merlimat @codelipenghui 
   
   > In the example above, when broker-1 will be able to re-establish a session 
with ZK, it will get the notification that the ownership has changed. 
   > For the semantics guarantees, there is no problem or race condition: 
   > * The ledgers where broker-1 was writing are getting fenced by the new 
broker that takes over
   > * broker-1 is not able to create a new ledger (because of no zk session) 
and won't anyway be able to update the ledger list, since the version has 
already changed.
   
   > In this case, broker1 will revalidating the lock and give up the ownership 
of the topic. And only the request going to broker-1 will get the wrong owner, 
right? Maybe we can always forward the lookup request to other brokers if the 
requested broker is waiting for zookeeper reconnection?
   
   Sure, agree with you. But there is a scenario which is not expected. Let me 
share a flow to you.
   
   1. `broker-2` lost ZK session
   1. switch the topic's owner to `broker-0`.
   1. the topic object in `broker-2`'s memory was marked `fenced`, because the 
ledger was marked `fenced` first.
     a. **(Highlight)** Issue: the object will always be in `broker-2`'s 
memory, there is no mechanism to unload it so far.
     b. Issue: the consumers/producers who connected to `broker-2` will get a 
fenced error.
   1. `broker-2` connected to ZK.
   1. switch the topic's owner to `broker-2` since it is backed.
   1. **(Highlight)** Issue: the consumers/producers will get a fenced 
error.... 
   
   Agree with you, since the improvement that 
`zookeeperSessionExpiredPolicy=reconnect`, I will draft another PR to fix the 
issue described above. And I will close the current PR after the PR that tries 
to fix the issues submitted.


-- 
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: commits-unsubscr...@pulsar.apache.org

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

Reply via email to