Skip to content

Conversation

guyinyou
Copy link
Contributor

  • Add snapshot backup and recovery functionality to TimerWheel
  • Add configuration options for snapshot control with backward compatibility
  • Implement atomic flush operations with synchronization locks
  • Add snapshot file management (creation, cleanup, selection)
  • Support recovery from snapshot files to avoid rebuilding TimerWheel
  • Add TimerFlushService.flush() method for manual flush operations

This addresses the issue where discrete TimerWheel state cannot be recovered from TimerLog alone, ensuring data consistency and improving recovery performance.

Configuration changes:

  • timerWheelSnapshotFlush: enable/disable snapshot functionality (default: false)
  • timerWheelDefaultFlush: enable/disable default flush behavior (default: true)
  • timerWheelSnapshotIntervalMs: snapshot creation interval (default: 10s)

Change-Id: I801ce7ca6330d02aefcae905e59e1e2b7642ebf5

Which Issue(s) This PR Fixes

Fixes #9735

Brief Description

How Did You Test This Change?

@codecov-commenter
Copy link

codecov-commenter commented Sep 25, 2025

Codecov Report

❌ Patch coverage is 26.36364% with 81 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.10%. Comparing base (64999c1) to head (c4a54dd).

Files with missing lines Patch % Lines
...va/org/apache/rocketmq/store/timer/TimerWheel.java 15.62% 51 Missing and 3 partials ⚠️
...apache/rocketmq/store/timer/TimerMessageStore.java 42.10% 19 Missing and 3 partials ⚠️
...ache/rocketmq/store/config/MessageStoreConfig.java 37.50% 5 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #9736      +/-   ##
=============================================
- Coverage      48.20%   48.10%   -0.11%     
+ Complexity     12168    12145      -23     
=============================================
  Files           1313     1313              
  Lines          93340    93424      +84     
  Branches       11962    11977      +15     
=============================================
- Hits           44997    44942      -55     
- Misses         42771    42900     +129     
- Partials        5572     5582      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@guyinyou guyinyou force-pushed the dev_fix_timer_wheel_for_develop_000 branch from 908f5ae to bcd8268 Compare September 25, 2025 11:46
@RongtongJin RongtongJin added the ha label Sep 26, 2025
guyinyou added 4 commits October 9, 2025 10:13
- Add snapshot backup and recovery functionality to TimerWheel
- Add configuration options for snapshot control with backward compatibility
- Implement atomic flush operations with synchronization locks
- Add snapshot file management (creation, cleanup, selection)
- Support recovery from snapshot files to avoid rebuilding TimerWheel
- Add TimerFlushService.flush() method for manual flush operations

This addresses the issue where discrete TimerWheel state cannot be
recovered from TimerLog alone, ensuring data consistency and
improving recovery performance.

Configuration changes:
- timerWheelSnapshotFlush: enable/disable snapshot functionality (default: false)
- timerWheelDefaultFlush: enable/disable default flush behavior (default: true)
- timerWheelSnapshotIntervalMs: snapshot creation interval (default: 10s)

Change-Id: I801ce7ca6330d02aefcae905e59e1e2b7642ebf5
fix
Change-Id: I97968a6b87d55c73ce871b3522c67b8b543d6eb2
fix
Change-Id: Id751e63ddd20ca6223d83d8057623f19e54fa3ca
fix
Change-Id: I8099c89ebded4f5b66eb98537396afc75b147583
@guyinyou guyinyou force-pushed the dev_fix_timer_wheel_for_develop_000 branch from c4a54dd to a2a3fe3 Compare October 9, 2025 02:14
fix
Change-Id: I1610f1ebba7b05de8517111155f2116025c65e1e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Add TimerWheel snapshot mechanism for reliable recovery

3 participants