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

Add ability to create db snapshots #3383

Merged
merged 8 commits into from
Jul 5, 2024
Merged

Add ability to create db snapshots #3383

merged 8 commits into from
Jul 5, 2024

Conversation

batconjurer
Copy link
Member

@batconjurer batconjurer commented Jun 6, 2024

Describe your changes

Resolves the first two points of Issue #3307:

  • Add the ability to create chunkable snapshots to our rocksdb implementation
  • Spawn a background task to create snapshots are certain blockheights

Specifically adds a config parameter that indicates after how many blocks a snapshot should be created. If set, then on the corresponding calls to commit, a background task is spun up that takes a snapshot of rocksDB and writes it in a convenient format to a file. This file contains metadata of how to be broken up into chunks. Once a new snapshot is created, older snapshots are removed.

Indicate on which release or other PRs this topic is based on

v0.39.0

Checklist before merging to draft

  • I have added a changelog
  • Git history is in acceptable state

@batconjurer batconjurer requested review from tzemanovic and sug0 June 6, 2024 12:11
tzemanovic
tzemanovic previously approved these changes Jun 6, 2024
@cwgoes cwgoes mentioned this pull request Jun 8, 2024
Copy link
Collaborator

@sug0 sug0 left a comment

Choose a reason for hiding this comment

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

left a couple of comments

Co-authored-by: Tiago Carvalho <sugoiuguu@tfwno.gf>
batconjurer and others added 2 commits June 12, 2024 10:01
Co-authored-by: Tiago Carvalho <sugoiuguu@tfwno.gf>
Copy link

codecov bot commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 66.52893% with 81 lines in your changes missing coverage. Please review.

Project coverage is 53.93%. Comparing base (879a326) to head (f768ef9).
Report is 4 commits behind head on main.

Files Patch % Lines
crates/node/src/shims/abcipp_shim.rs 0.00% 58 Missing ⚠️
crates/node/src/storage/rocksdb.rs 92.14% 11 Missing ⚠️
crates/node/src/shims/abcipp_shim_types.rs 0.00% 6 Missing ⚠️
crates/storage/src/db.rs 0.00% 3 Missing ⚠️
crates/node/src/shell/mod.rs 91.30% 2 Missing ⚠️
crates/node/src/lib.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3383      +/-   ##
==========================================
+ Coverage   53.92%   53.93%   +0.01%     
==========================================
  Files         317      317              
  Lines      107575   107786     +211     
==========================================
+ Hits        58011    58137     +126     
- Misses      49564    49649      +85     

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

@batconjurer batconjurer requested a review from sug0 June 13, 2024 08:54
brentstone added a commit that referenced this pull request Jun 25, 2024
* bat/feat/db-snapshots:
  addressing review comment
  review comments
  Update crates/node/src/storage/rocksdb.rs
  Update crates/node/src/storage/rocksdb.rs
  changelog
  [feat]: Added snapshot frequency to config
  [feat]: Added ability to create snapshots of rocksDb
  WIP
brentstone added a commit that referenced this pull request Jun 25, 2024
* bat/feat/db-snapshots:
  addressing review comment
  review comments
  Update crates/node/src/storage/rocksdb.rs
  Update crates/node/src/storage/rocksdb.rs
  changelog
  [feat]: Added snapshot frequency to config
  [feat]: Added ability to create snapshots of rocksDb
  WIP
brentstone added a commit that referenced this pull request Jun 25, 2024
* bat/feat/db-snapshots:
  addressing review comment
  review comments
  Update crates/node/src/storage/rocksdb.rs
  Update crates/node/src/storage/rocksdb.rs
  changelog
  [feat]: Added snapshot frequency to config
  [feat]: Added ability to create snapshots of rocksDb
  WIP
brentstone added a commit that referenced this pull request Jul 4, 2024
* origin/bat/feat/db-snapshots:
  addressing review comment
  review comments
  Update crates/node/src/storage/rocksdb.rs
  Update crates/node/src/storage/rocksdb.rs
  changelog
  [feat]: Added snapshot frequency to config
  [feat]: Added ability to create snapshots of rocksDb
  WIP
@brentstone brentstone merged commit bb55538 into main Jul 5, 2024
18 of 19 checks passed
@brentstone brentstone deleted the bat/feat/db-snapshots branch July 5, 2024 21:16
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.

4 participants