tendermint / tm-db

Common database interface for various database backends for Tendermint Core and Cosmos SDK
Apache License 2.0
89 stars 136 forks source link

goleveldb: ForceCompact #216

Closed tac0turtle closed 2 years ago

codecov[bot] commented 2 years ago

Codecov Report

Merging #216 (35392b4) into master (ce3673b) will decrease coverage by 0.06%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #216      +/-   ##
==========================================
- Coverage   68.57%   68.51%   -0.07%     
==========================================
  Files          27       27              
  Lines        2126     2128       +2     
==========================================
  Hits         1458     1458              
- Misses        593      595       +2     
  Partials       75       75              
Impacted Files Coverage Δ
goleveldb.go 58.91% <0.00%> (-0.93%) :arrow_down:
Impacted Files Coverage Δ
goleveldb.go 58.91% <0.00%> (-0.93%) :arrow_down:
tac0turtle commented 2 years ago

yes, in the sdk and tendermint we Call delete on the db but with lam trees the space on disk is not reclaimed until compaction is completed, in our environment we write so often the db doesn't have enough time to sufficiently compact itself. By adding force compact I have two things planned, in the short term I wrote a tool that prunes blocks, state and app state then calls force compact on the entire db. With this tool, after pruning the stores I would need to compact it. In the mid term id like to add force compacting to the sdk to avoid seekcompaction on goleveldb.

The overall goal is optimisations with this. It allows the application to control compaction instead of passing it on to the default settings of the db