Skip to content
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

replication: For taking snapshots use commit_index, not last_applied #50

Conversation

freeekanayaka
Copy link
Member

Currently entries are applied synchronously by the FSM as soon as they get committed.

However, we want to also support disk-based FSMs that might need to apply entries asynchronously. Using commit_index instead of last_applied when taking snapshots means that the raft engine will be able to request a snapshot even if some entries are still being applied by the FSM. Consumer code will queue the snapshot request and process it when outstanding entries have been applied.

Currently entries are applied synchronously by the FSM as soon as they get
committed.

However, we want to also support disk-based FSMs that might need to apply
entries asynchronously. Using commit_index instead of last_applied when taking
snapshots means that the raft engine will be able to request a snapshot even if
some entries are still being applied by the FSM. Consumer code will queue the
snapshot request and process it when outstanding entries have been applied.

Signed-off-by: Free Ekanayaka <free@ekanayaka.io>
Apparently xfs needs minimum 300M on 6.x kernels.

Signed-off-by: Free Ekanayaka <free@ekanayaka.io>
@freeekanayaka freeekanayaka merged commit d3828ee into cowsql:main Sep 14, 2023
@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Patch coverage: 83.33% and project coverage change: -0.04% ⚠️

Comparison is base (9b3151a) 75.19% compared to head (baff690) 75.15%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
- Coverage   75.19%   75.15%   -0.04%     
==========================================
  Files          50       50              
  Lines        8935     8937       +2     
  Branches     2214     2214              
==========================================
- Hits         6719     6717       -2     
- Misses        981      986       +5     
+ Partials     1235     1234       -1     
Files Changed Coverage Δ
src/replication.c 67.42% <83.33%> (+0.08%) ⬆️

... and 1 file with indirect coverage changes

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

@freeekanayaka freeekanayaka deleted the use-commit-index-instead-of-last-applied branch September 14, 2023 21:51
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.

None yet

1 participant