Skip to content

[ISSUE #9705] Improve persist() method reliability to prevent broker startup failure after power outages#9706

Merged
RongtongJin merged 13 commits intoapache:developfrom
guyinyou:dev_config_persist
Sep 18, 2025
Merged

[ISSUE #9705] Improve persist() method reliability to prevent broker startup failure after power outages#9706
RongtongJin merged 13 commits intoapache:developfrom
guyinyou:dev_config_persist

Conversation

@guyinyou
Copy link
Copy Markdown
Contributor

  • Add atomic file backup mechanism in persist() methods
  • Delete corrupted config files during startup to avoid bak file pollution
  • Add directory sync to ensure file operations visibility

Fixes: TimerMetrics#persist, TransactionMetrics#persist, ConfigManager#persist

Which Issue(s) This PR Fixes

Fixes #9705

Brief Description

How Did You Test This Change?

guyinyou added 6 commits September 15, 2025 17:29
- Add atomic file backup mechanism in persist() methods
- Delete corrupted config files during startup to avoid bak file pollution
- Add directory sync to ensure file operations visibility

Fixes: TimerMetrics#persist, TransactionMetrics#persist, ConfigManager#persist
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 16, 2025

Codecov Report

❌ Patch coverage is 60.00000% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.12%. Comparing base (73e8fdb) to head (172f06f).
⚠️ Report is 179 commits behind head on develop.

Files with missing lines Patch % Lines
...java/org/apache/rocketmq/common/ConfigManager.java 41.66% 12 Missing and 2 partials ⚠️
...ocketmq/broker/transaction/TransactionMetrics.java 61.11% 5 Missing and 2 partials ⚠️
.../org/apache/rocketmq/store/timer/TimerMetrics.java 78.26% 4 Missing and 1 partial ⚠️
...c/main/java/org/apache/rocketmq/common/MixAll.java 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #9706      +/-   ##
=============================================
- Coverage      48.22%   48.12%   -0.11%     
+ Complexity     12167    12139      -28     
=============================================
  Files           1313     1313              
  Lines          93238    93233       -5     
  Branches       11950    11944       -6     
=============================================
- Hits           44966    44866     -100     
- Misses         42708    42793      +85     
- Partials        5564     5574      +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.

fuyou001
fuyou001 previously approved these changes Sep 16, 2025
Copy link
Copy Markdown
Contributor

@fuyou001 fuyou001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RongtongJin RongtongJin merged commit 0e72809 into apache:develop Sep 18, 2025
13 of 15 checks passed
@guyinyou guyinyou deleted the dev_config_persist branch September 19, 2025 01:44
@RongtongJin RongtongJin added the ha label Sep 26, 2025
lizhimins added a commit to lizhimins/rocketmq that referenced this pull request Oct 13, 2025
This reverts commit 0e72809.

Change-Id: Ibd3ad0f35020c5fa97b1435e938f95da908b8ad5
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] Improve persist() method reliability to prevent broker startup failure after power outages

4 participants