Skip to content

Conversation

@Besroy
Copy link
Contributor

@Besroy Besroy commented Dec 12, 2025

Add manual snapshot creation API for log truncation control.
This implements option 1 from #835 with two capabilities:

  1. Update truncation upper limit: Allows truncating logs up to a specified threshold when the in-memory truncation_upper_limit is zero (e.g., after restart).
  2. Trigger snapshot via NuRaft API: Leverages NuRaft's snapshot creation API with two modes:
    • Async mode (recommended with ongoing traffic): Schedules snapshot creation for the next available committed log
    • Sync mode (for idle periods): Triggers snapshot creation immediately
      NuRaft handles race conditions internally so we don't need to do more (e.g., rejecting concurrent snapshot requests and using distance checks and flags to prevent concurrency issues)

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 9.52381% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.56%. Comparing base (1a0cef8) to head (e1af472).
⚠️ Report is 295 commits behind head on master.

Files with missing lines Patch % Lines
src/lib/replication/repl_dev/raft_repl_dev.cpp 14.28% 11 Missing and 1 partial ⚠️
src/lib/replication/service/raft_repl_service.cpp 0.00% 5 Missing ⚠️
src/lib/replication/repl_dev/solo_repl_dev.h 0.00% 1 Missing ⚠️
src/lib/replication/service/generic_repl_svc.cpp 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #840      +/-   ##
==========================================
- Coverage   56.51%   49.56%   -6.95%     
==========================================
  Files         108      110       +2     
  Lines       10300    11338    +1038     
  Branches     1402     5344    +3942     
==========================================
- Hits         5821     5620     -201     
+ Misses       3894     2101    -1793     
- Partials      585     3617    +3032     

☔ 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.

@Besroy
Copy link
Contributor Author

Besroy commented Dec 12, 2025

No need, found the root cause is we didn't save receiving_snapshot_ in srv_state

@Besroy Besroy closed this Dec 12, 2025
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