Skip to content

Add in-process compaction support to databases #49

Closed

Description

@lasarojc

Was tendermint/tendermint#9743

Summary

Experiment with adding in-proces compaction, so that nodes don't need to be stopped to perform compaction. This issue was originally targeting levelDB but we added support for this to all cometbft database backends that support this feature: RocksDB, PebbleDB and LevelDB.

Problem Definition

Background

One of the most common problem that operators signal is that storage growth is unbounded and compaction doesn't work. Some operators stop their node, trigger experimental-compact-goleveldb (#8564) which deletes old data, and then restart their node.

Why do we need this feature?

The use of command experimental-compact-goleveldb has the disadvantage that while this is running the node is stopped and is missing blocks. It typically take on the order of tens of minutes to finish compaction of a node on a production network, so the number of missed blocks can be significant.

Proposal

We'll go about this incrementally

  • Tendermint team does initial de-risking and sanity checks to see that in-process compaction can be implemented safely
    • Add a new database type that does compaction
  • We ask an operator to deploy an early experiment replacing one of their full nodes with the patched tendermint version that has in-process compaction
    • relayer team tests relaying against that node, monitor general health
  • We collect advanced metrics on latency in particular, as well as storage growth evolution

Activity

  1. added
    backlog
    on Dec 23, 2022
  2. removed their assignment
    on Feb 7, 2023
  3. added
    P:storage-optimization
    on Jun 20, 2023
  4. added this to the 2023-Q4 milestone on Nov 23, 2023
  5. self-assigned this
    on Jan 3, 2024
  6. modified the milestones: 2023-Q4, 2024-Q1 on Jan 9, 2024
  7. moved this from Todo to Blocked in CometBFTon Jan 17, 2024
  8. moved this from Blocked to Ready for Review in CometBFTon Feb 12, 2024
  9. jmalicevic commented on Feb 19, 2024

    @jmalicevic
    Collaborator

    Closed with #1972 and cometbft/cometbft-db#111 . Followed up with a fix resolving: #2476

  10. moved this from Ready for Review to Done in CometBFTon Feb 19, 2024
  11. jmalicevic commented on Feb 29, 2024

    @jmalicevic
    Collaborator

    Local experiments confirmed that the storage footprint with golevelDB shrinks only when forcing compaction. This was confirmed by running the code on a real chain by Informal staking.

  12. changed the title [-]Add in-process compaction support to LevelDB[/-] [+]Add in-process compaction support to databases[/+] on Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P:storage-optimizationbacklogstorage

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions