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

[Merged by Bors] - prune active set from ballot blob #5032

Closed
wants to merge 3 commits into from

Conversation

countvonzero
Copy link
Contributor

@countvonzero countvonzero commented Sep 19, 2023

Motivation

Closes #4985

Changes

  • actually prune active set from ballot blobs in db
  • use a empty migration to facilitate the pruning.
    we only want to prune/vacuum/checkpoint once per software upgrade
    the code allow any upgrade from migration <=4 to 5 to
    • extract active set from ballots
    • prune active set from blob
    • vacuum and checkpoint

the final size of the state should be < 1GB

@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Merging #5032 (2308b2c) into develop (23f65a2) will decrease coverage by 0.1%.
Report is 1 commits behind head on develop.
The diff coverage is 50.0%.

@@            Coverage Diff            @@
##           develop   #5032     +/-   ##
=========================================
- Coverage     77.1%   77.0%   -0.1%     
=========================================
  Files          257     257             
  Lines        30277   30277             
=========================================
- Hits         23349   23343      -6     
- Misses        5402    5408      +6     
  Partials      1526    1526             
Files Changed Coverage Δ
sql/ballots/util/extract.go 64.1% <25.0%> (-4.5%) ⬇️
sql/database.go 71.7% <100.0%> (+0.9%) ⬆️

... and 2 files with indirect coverage changes

Copy link
Contributor

@dshulyak dshulyak left a comment

Choose a reason for hiding this comment

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

migrations need to be adjusted, as i had to add one

@countvonzero countvonzero changed the title FOR NEXT RELEASE: prune active set from ballot blob prune active set from ballot blob Sep 25, 2023
@countvonzero
Copy link
Contributor Author

bors merge

@@ -34,6 +34,7 @@ In order to enable provide following configuration:
Ephemeral data are deleted and state compacted at the time of upgrade. In steady-state, data is pruned periodically.
* [#5021](https://github.com/spacemeshos/go-spacemesh/pull/5021) Drop support for old certificate sync protocol.
* [#5024](https://github.com/spacemeshos/go-spacemesh/pull/5024) Active set will be saved in state separately from ballots.
* [#5032](https://github.com/spacemeshos/go-spacemesh/pull/5032) Ativeset data pruned from ballots.
Copy link
Contributor

Choose a reason for hiding this comment

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

we should put a bit more data about this. e.g expected time and amount of storage required to perform this migration (e.g. WAL is the size of database right?) . we can do that after benchmarking in cloud

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. WAL will be the size of the pre-vacuumed db (it's being used as a tmp storage during vacuum).
will update after testing.

bors bot pushed a commit that referenced this pull request Sep 25, 2023
## Motivation
Closes #4985

## Changes
- actually prune active set from ballot blobs in db
- use a empty migration to facilitate the pruning. 
  we only want to prune/vacuum/checkpoint once per software upgrade
  the code allow any upgrade from migration <=4 to 5 to
  - extract active set from ballots
  - prune active set from blob
  - vacuum and checkpoint

the final size of the state should be < 1GB
@bors
Copy link

bors bot commented Sep 25, 2023

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Sep 25, 2023
## Motivation
Closes #4985

## Changes
- actually prune active set from ballot blobs in db
- use a empty migration to facilitate the pruning. 
  we only want to prune/vacuum/checkpoint once per software upgrade
  the code allow any upgrade from migration <=4 to 5 to
  - extract active set from ballots
  - prune active set from blob
  - vacuum and checkpoint

the final size of the state should be < 1GB
@countvonzero
Copy link
Contributor Author

bors cancel

@bors
Copy link

bors bot commented Sep 25, 2023

Canceled.

@countvonzero
Copy link
Contributor Author

bors merge

bors bot pushed a commit that referenced this pull request Sep 25, 2023
## Motivation
Closes #4985

## Changes
- actually prune active set from ballot blobs in db
- use a empty migration to facilitate the pruning. 
  we only want to prune/vacuum/checkpoint once per software upgrade
  the code allow any upgrade from migration <=4 to 5 to
  - extract active set from ballots
  - prune active set from blob
  - vacuum and checkpoint

the final size of the state should be < 1GB
@bors
Copy link

bors bot commented Sep 25, 2023

Pull request successfully merged into develop.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title prune active set from ballot blob [Merged by Bors] - prune active set from ballot blob Sep 25, 2023
@bors bors bot closed this Sep 25, 2023
@bors bors bot deleted the finally-prune-activeset branch September 25, 2023 17:59
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.

compress sqlite state after pruning
2 participants