user-Param opened a new pull request, #11509:
URL: https://github.com/apache/rocketmq/pull/11509
Fixes #11508
Add per-page dirty tracking to TimerWheel.flush(). Instead of scanning
every byte in the wheel on each flush, track which logical 4 KiB pages
were modified via putSlot/reviseSlot and only scan dirty pages.
Use a claim/clear CAS pattern on an AtomicIntegerArray of page flags:
- Writers mark pages dirty (PAGE_DIRTY) in finally blocks
- Flush claims dirty pages (PAGE_DIRTY -> PAGE_CLAIMED), scans only those,
then clears to clean (PAGE_CLAIMED -> PAGE_CLEAN)
- If a writer marks dirty during processing, CAS fails and page stays dirty
- If copy throws, page is restored to dirty for retry
Retains MappedByteBuffer.force() even when all flags are clean.
Preserves slot/file layout and snapshot backup path.
Signed-off-by: user-Param <[email protected]>
--
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]