thetumbled commented on PR #21692:
URL: https://github.com/apache/pulsar/pull/21692#issuecomment-1867283912

   > > > why do we update the cursor when every check ?
   > > 
   > > 
   > > If the consumer do not commit the offset for any reason, the 
`lastActive` will never be updated, which will result into incorrect 
subscription deletion. As we know that the consumer is connected, we should 
update `lastActive` when doing check.
   > 
   > in this case, the consumer is connected, how could the code run into 
`sub.delete`
   > 
   > 
https://github.com/apache/pulsar/blob/8beac8b12ef7c0ef54529fbb7e4e76c54dea6283/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java#L2982-L2985
   
   If the broker1 shutdown ungracefully, the topic will be loaded on broker2 
without update the `lastActive` field to zk, and the broker2 load  the topic 
with old `lastActive` field from zk. If broker2 check the inactive sub before 
any consumer connect to this sub, the sub will be deleted. 
   This problem is simillar to https://github.com/apache/pulsar/pull/17573.


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