8000 feat/testing: port pruning mechanism to 0.37 by jmalicevic · Pull Request #2113 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat/testing: port pruning mechanism to 0.37 #2113

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

Conversation

jmalicevic
Copy link
Contributor
@jmalicevic jmalicevic commented Jan 24, 2024

Ports pruning mechanism to a branch based of 0.37.x-experimental. The purpose of this is to evaluate the storage related changes done in Q3 2023 and Q1 2024 in a real setting and the target branch should be used only for testing.

This PR merges only the pruning mechanism for blocks, ABCI Results and state and features needed for it to work - without adding gRPC services or any indexer pruning mechanisms:

Commits cherry-picked:


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments
  • Title follows the Conventional Commits spec

jmalicevic and others added 2 commits October 9, 2023 09:51
* Added pruning mechanism for blocks and abci block results
* Added support for datacompanion and application retain heights
---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
@jmalicevic jmalicevic added the P:storage-optimization Priority: Give operators greater control over storage and storage optimization label Jan 24, 2024
@jmalicevic jmalicevic self-assigned this Jan 24, 2024
jmalicevic and others added 7 commits January 24, 2024 13:43
…dator' into jasmina/1444-v037-pruning-mechanism
* Metrics to report on the data companion retain height

* Added metric to report the application retain height as well

* Added metrics to report the blockstore base height and the abci results base height
---------

Co-authored-by: Thane Thomson <connect@thanethomson.com>
* state: Invert logic of whether retain heights are set to be more readable

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor findMinRetainHeight logic for clarity and to respect config

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Rename findMinRetainHeight to findMinBlockRetainHeight for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Rename Pruner.SetApplicationRetainHeight to SetApplicationBlockRetainHeight for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Rename pruner SetCompanionRetainHeight to SetCompanionBlockRetainHeight for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - shorten local variable name

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - rename local method name for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - remove redundant condition

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - use helper instead of redefining logic

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - shorten local variable names

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - shorten local variable names

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor Pruner.SetApplicationBlockRetainHeight logic

The application retain height should be set regardless of what the
companion retain height is. Pruning should take place based on whichever
of the two values is lower. There is no need to consider the companion
retain height in this logic.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor Pruner.SetCompanionBlockRetainHeight logic

Similar refactor to that done for
Pruner.SetApplicationBlockRetainHeight. There is no need to consider the
application retain height during this function call.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor Pruner.SetABCIResRetainHeight logic

Aligns the logic of this method similar to that in the other retain
height setter methods. Also fixes a logic bug where setting the retain
height would skip updating the metrics.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - shorten local variable names

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Simplify pruner logic assuming retain heights are always set

We can simplify the pruner logic if we assume that the initial retain
heights are always set on node startup.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* node: Tell pruner whether companion is enabled

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Expand error message detail

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state+store: Align tests with new logic

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Refactor - shorten local variable names

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* rpc/grpc: Return trace IDs in error responses from pruning service

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* node: Refactor/expand pruning service initialization logic

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* test/e2e: Minor cosmetic tweaks to gRPC tests

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* test/e2e: Enable data companion pruning

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* node: Refactor - extract pruner creation as function

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* test/e2e: Only enable companion-based pruning on full nodes and validators

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Only start ABCI results pruning routine when data companion is enabled

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Fix TestMinRetainHeight logic

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* node: Fix companion retain height initialization logic

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* test/e2e: Expand testing framework

Allows explicit control over whether or not pruning should take a data
companion into account for full nodes or validators in our E2E
framework.

This allows greater flexibility in the E2E framework to test nodes both
with and without data companion-related functionality.

Expands our standard CI manifest to expect data companions attached to
two of the nodes.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Rename background routines

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* node: Apply change from code review

Signed-off-by: Thane Thomson <connect@thanethomson.com>

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
@jmalicevic jmalicevic marked this pull request as ready for review January 24, 2024 15:00
@jmalicevic jmalicevic requested a review from a team as a code owner January 24, 2024 15:00
@jmalicevic jmalicevic merged commit e45c01e into storage/tmp/v0.37.x-testing-validator Jan 25, 2024
@jmalicevic jmalicevic deleted the jasmina/1444-v037-pruning-mechanism branch January 25, 2024 09:13
@jmalicevic jmalicevic restored the jasmina/1444-v037-pruning-mechanism branch January 25, 2024 09:13
@adizere adizere added this to the 2024-Q1 milestone Jan 30, 2024
czarcas7ic added a commit to osmosis-labs/cometbft that referenced this pull request Apr 22, 2024
This PR merges only the pruning mechanism for blocks, ABCI Results and
state and features needed for it to work - without adding gRPC services
or any indexer pruning mechanisms:

Commits cherry-picked:
- [x] 8fee3cd (cometbft#1150) - initial pruning mechanism PR
- [x] bc6e5f2 (cometbft#1234) - metrics for monitoring pruning behaviour
- [x] d736369 (cometbft#1271) - Fixes to the height check logic minus the gRPC
related changes
- [x] ad5bff2 (cometbft#1490) - Observer fix
- [x] 48d7c1e (cometbft#1467) - e2e race condition fix.
@zrbecker zrbecker deleted the jasmina/1444-v037-pruning-mechanism branch February 7, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P:storage-optimization Priority: Give operators greater control over storage and storage optimization
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants
0