dragonls commented on PR #17573:
URL: https://github.com/apache/pulsar/pull/17573#issuecomment-1249202159

   After discussed with @codelipenghui , this PR mainly fix the bug that 
subscription may be deleted unexpectedly caused by `lastActive` not being 
updated in time, which depends on the `lastActive` persistence in zk.
   
   `lastActive` is saved in zk in 
`org.apache.bookkeeper.mledger.impl.ManagedCursorImpl#persistPositionMetaStore`:
   
https://github.com/apache/pulsar/blob/d7c09be15c3502e95bbd5862b210cc8d7f473c1e/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java#L2500-L2514
   
   However, the persistence is triggered only in 4 places:
   
![image](https://user-images.githubusercontent.com/2565118/190616653-58d7ec18-e998-4e7c-b39c-a1689516e307.png)
   
   All of them are not high frequency triggered, which means the unexpectedly 
subscription deletion still can happen during two persistence with broker 
shutdown not gracefully.
   
   The better solution is to save the `lastActive` into cursor ledger instead 
of only save to zk, but this is not the problem this PR solving, and need 
further discussion.


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