Skip to content

add parameter for initiating bgrewriteaof on exceeding maximum AOF size #2368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

kronwerk
Copy link
Contributor

there are some scenarios of filling up the whole disk besides any chosen AOF rewrite strategy - the simplest is this:

  • we have auto-aof-rewrite-percentage 100,
  • and last automatic rewrite compacted AOF to 51% of disk,
    -> we'll never try again.

we can lower auto-percentage, but in some cases it's not what we want to. I suggest that we add soft upper limit in this PR:

  • if no AOF rewrite is running currently,
  • and limit is set in config,
  • and AOF exceed the limit,
  • and last rewrite compacted AOF to somewhat smaller than limit (otherwise we might end up with useless attempts of uninterrupted rewrites)
    -> bgrewriteaof is initiated.

this doesn't completely solves the problem, but gives some additional possibilities for some users to improve the situation initially described in #540 (noticed that solution from the issue seems to be inappropriate for some cases)

Signed-off-by: kronwerk <kronwerk@users.noreply.github.com>
Copy link

codecov bot commented Jul 17, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 71.36%. Comparing base (663dac9) to head (6bff01a).

Files with missing lines Patch % Lines
src/aof.c 70.00% 3 Missing ⚠️
src/server.c 90.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #2368      +/-   ##
============================================
+ Coverage     71.30%   71.36%   +0.06%     
============================================
  Files           123      123              
  Lines         67122    67135      +13     
============================================
+ Hits          47859    47912      +53     
+ Misses        19263    19223      -40     
Files with missing lines Coverage Δ
src/config.c 78.47% <ø> (ø)
src/server.h 100.00% <ø> (ø)
src/server.c 88.09% <90.00%> (-0.01%) ⬇️
src/aof.c 80.38% <70.00%> (-0.15%) ⬇️

... and 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kronwerk kronwerk marked this pull request as ready for review July 17, 2025 19:48
@kronwerk
Copy link
Contributor Author

@valkey-io/core-team PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant