eolivelli opened a new pull request #9083:
URL: https://github.com/apache/pulsar/pull/9083


   
   Fixes #9082
   
   ### Motivation
   In case of topic unload the ManagedLedger rolls a new ledger and this 
confuses the search for messages to be expired.
   
   This is how OpFindNewest (the operation involved in message expiry, 
PersistentMessageExpiryMonitor) works:
   - first check if first message is expired
   - test in the last message
   - perform a search...
   
   At step two we are jumping to a position that is not valid, and the search 
ends immediately, returning only the first message
   
   ### Modifications
   
   Ensure that we are jumping only to a valid position, this change allows the 
PersistentMessageExpiryMonitor to find the best range of messages to expire.
   
   ### Verifying this change
   
   
   This change added tests:
   - one reproducer for the problem, that now is fixes
   - another test case for the expected end-to-end behaviour for a consumer 
that waits too much and messages expire
   
   It can be also verified trying to reproduce manually the reproducer at 
#9082, after applying this patch the issue is no more reproducible
   


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