Skip to content

Add ability to create db snapshots#3383

Merged
brentstone merged 8 commits intomainfrom
bat/feat/db-snapshots
Jul 5, 2024
Merged

Add ability to create db snapshots#3383
brentstone merged 8 commits intomainfrom
bat/feat/db-snapshots

Conversation

@batconjurer
Copy link
Copy Markdown
Collaborator

@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 sug0 and tzemanovic 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
Copy Markdown
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>
@codecov
Copy link
Copy Markdown

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
@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