Technoboy- opened a new pull request, #16404:
URL: https://github.com/apache/pulsar/pull/16404

   Cherry-pick #12698
   ### Motivation
   
   Fix lost compaction data due to compaction properties missed during 
reset-cursor.
   
   1. The compaction reader will seek to the earliest position to read data 
from the topic, but the compaction properties missed during the cursor reset, 
this will lead to the inited compaction subscribe without compaction horizon, 
so the compaction reader will skip the last compacted data. It will only happen 
when init the compaction subscription, so can introduced by the loadbalance or 
topic unloading manually.
   
   2. Advance the cursor should also keep the properties, otherwise, the 
properties will lost during the cursor trimming.
   
   ### Changes
   
   1. Keep the properties for resetting the cursor while the cursor is for data 
compaction.
   2. Copy the properties to the new mark delete entry while advance the 
cursor, this is triggered byt the managed ledger internal, so it's not only for 
compacted topic, the internal task should not loss the properties when trimming 
the cursor.
   
   ### Tests
   
   New tests added to make sure the compaction will not loss data during topic 
unloading and the reader can read all the compacted data after the compaction 
task complete
   
   ### Documentation
   
   Check the box below and label this PR (if you have committer privilege).
   
   Need to update docs? 
   
   - [ ] `doc-required` 
     
     (If you need help on updating docs, create a doc issue)
     
   - [x] `no-need-doc` 
     
     (Please explain why)
     
   - [ ] `doc` 
     
     (If this PR contains doc changes)
   
   
   


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