Skip to content

Fix forkless save remaining time estimate - #4468

Merged
JimB123 merged 1 commit into
valkey-io:forklessfrom
nitaicaro:forkless-fix-eta-estimate
Aug 20, 2026
Merged

Fix forkless save remaining time estimate#4468
JimB123 merged 1 commit into
valkey-io:forklessfrom
nitaicaro:forkless-fix-eta-estimate

Conversation

@nitaicaro

Copy link
Copy Markdown
Contributor

forkless_estimated_seconds_remaining sampled the live key count now, but compared it against dbentries_processed, which counts progress through the point-in-time snapshot taken when the save started. If keys were deleted during the save, the live count could drop below dbentries_processed and the estimate went negative.

Use server.stat_current_save_keys_total, the key count captured when the save started, so both sides of the subtraction share the same baseline and the estimate stays non-negative.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5eaba11a-4f8b-4701-b3a7-9de4fad1a6a7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@valkey-review-bot valkey-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The ETA now uses a stable baseline, but that global can be reset by an unrelated fork while the forkless iterator is still active.

Comment thread src/forkless.c
@nitaicaro
nitaicaro force-pushed the forkless-fix-eta-estimate branch 3 times, most recently from f87e3d9 to ca8b1ee Compare August 19, 2026 18:59
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.40%. Comparing base (0a50265) to head (4487472).
⚠️ Report is 5 commits behind head on forkless.

Additional details and impacted files
@@             Coverage Diff              @@
##           forkless    #4468      +/-   ##
============================================
- Coverage     79.69%   79.40%   -0.29%     
============================================
  Files           175      175              
  Lines         94841    93222    -1619     
============================================
- Hits          75581    74024    -1557     
+ Misses        19260    19198      -62     
Files with missing lines Coverage Δ
src/forkless.c 84.86% <100.00%> (ø)

... and 25 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.

Comment thread src/forkless.c Outdated
…imate

forkless_estimated_seconds_remaining sampled the live key count now, but
compared it against dbentries_processed, which counts progress through
the point-in-time snapshot taken when the save started. If keys were
deleted during the save, the live count could drop below
dbentries_processed and the estimate went negative.

Use server.stat_current_save_keys_total, the key count captured when the
save started, so both sides of the subtraction share the same baseline
and the estimate stays non-negative.

Signed-off-by: Nitai Caro <caronita@amazon.com>
@nitaicaro
nitaicaro force-pushed the forkless-fix-eta-estimate branch from ca8b1ee to 4487472 Compare August 20, 2026 21:44
@JimB123
JimB123 merged commit 0989e39 into valkey-io:forkless Aug 20, 2026
28 checks passed
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.

2 participants