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

Improve database compaction and prune-states #5142

Merged
merged 6 commits into from
Feb 8, 2024

Conversation

michaelsproul
Copy link
Member

Issue Addressed

I noticed that prune-states doesn't actually clear any space on disk because we don't compact the freezer database after running it.

Proposed Changes

  • Compact the relevant columns of the freezer database after pruning states.
  • Add a new lighthouse db compact command for manually compacting specific columns in a specific DB (hot, freezer or blobs).
  • Add a --blobs-db option to lighthouse db inspect (and compact) so we can inspect the blobs DB as well as the freezer.

Additional Info

I've manually tested the tree-states version of these changes (#5097) and the compaction works correctly.

@michaelsproul michaelsproul changed the title Db compaction tweaks Improve database compaction and prune-states Jan 30, 2024
@michaelsproul michaelsproul added ready-for-review The code is ready for review low-hanging-fruit Easy to resolve, get it before someone else does! labels Feb 2, 2024
Copy link
Member

@realbigsean realbigsean left a comment

Choose a reason for hiding this comment

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

Love the addition of blob db compaction and inspection!!

beacon_node/store/src/leveldb_store.rs Outdated Show resolved Hide resolved
@realbigsean realbigsean added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Feb 7, 2024
Copy link
Member

@realbigsean realbigsean left a comment

Choose a reason for hiding this comment

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

LGTM

@realbigsean realbigsean added ready-for-merge This PR is ready to merge. and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Feb 7, 2024
@michaelsproul
Copy link
Member Author

@Mergifyio queue

Copy link

mergify bot commented Feb 8, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 6f442f2

mergify bot added a commit that referenced this pull request Feb 8, 2024
@mergify mergify bot merged commit 6f442f2 into sigp:unstable Feb 8, 2024
28 of 29 checks passed
danielramirezch pushed a commit to danielramirezch/lighthouse that referenced this pull request Feb 14, 2024
* Fix no-op state prune check

* Compact freezer DB after pruning

* Refine DB compaction

* Add blobs-db options to inspect/compact

* Better key size

* Fix compaction end key
@michaelsproul michaelsproul deleted the db-compaction-tweaks branch July 18, 2024 12:45
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database low-hanging-fruit Easy to resolve, get it before someone else does! ready-for-merge This PR is ready to merge. v5.0.0 Q1 2024
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants