Skip to content

feat(pruning): trigger explicitly compaction upon pruning (backport #1972)#2356

Merged
jmalicevic merged 3 commits intov1.xfrom
mergify/bp/v1.x/pr-1972
Feb 23, 2024
Merged

feat(pruning): trigger explicitly compaction upon pruning (backport #1972)#2356
jmalicevic merged 3 commits intov1.xfrom
mergify/bp/v1.x/pr-1972

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Feb 16, 2024

This is an automatic backport of pull request #1972 done by Mergify.
Cherry-pick of cfe8b88 has failed:

On branch mergify/bp/v1.x/pr-1972
Your branch is up to date with 'origin/v1.x'.

You are currently cherry-picking commit cfe8b888a.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   .changelog/unreleased/breaking-changes/1972-store-prune-abci-responses.md
	new file:   .changelog/unreleased/breaking-changes/1972-store-pruning-api-breaking.md
	new file:   .changelog/unreleased/features/1972-compaction-config.md
	new file:   .changelog/unreleased/features/1972-force-compaction-on-pruning.md
	modified:   config/config.go
	modified:   config/toml.go
	modified:   internal/state/indexer/block/indexer.go
	modified:   internal/state/indexer/block/kv/kv.go
	modified:   internal/state/mocks/store.go
	modified:   internal/state/pruner.go
	modified:   internal/state/store_test.go
	modified:   internal/state/txindex/kv/kv.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   internal/state/store.go
	both modified:   internal/store/store.go
	both modified:   node/node.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

Blocked on cometbft/cometbft-db#111 and
benchmarking

Addresses #49

Upon pruning we explicitly call the compaction function of the DB
backend. This has shown to immediately shrink the storage footprint.

We need to evaluate the duration of this compaction depending on the
storage size to be able to reason about the impact on Comet's regular
operations.

ToDo:
-Extend the `storage` config section with following parameters:
- [ ] `in-process-compaction = false #Enable or disable in-process
compaction. False by default`
- [ ] `in-process-compaction-interval = 10 #Interval in number of blocks
to trigger explicit compaction; 10 by default`

<!--

Please add a reference to the issue that this PR addresses and indicate
which
files are most critical to review. If it fully addresses a particular
issue,
please include "Closes #XXX" (where "XXX" is the issue number).

If this PR is non-trivial/large/complex, please ensure that you have
either
created an issue that the team's had a chance to respond to, or had some
discussion with the team prior to submitting substantial pull requests.
The team
can be reached via GitHub Discussions or the Cosmos Network Discord
server in
the #cometbft channel. GitHub Discussions is preferred over Discord as
it
allows us to keep track of conversations topically.
https://github.com/cometbft/cometbft/discussions

If the work in this PR is not aligned with the team's current
priorities, please
be advised that it may take some time before it is merged - especially
if it has
not yet been discussed with the team.

See the project board for the team's current priorities:
https://github.com/orgs/cometbft/projects/1

-->

---

#### PR checklist

- [ ] Tests written/updated
- [ ] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments

---------

Co-authored-by: Andy Nogueira <me@andynogueira.dev>
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
(cherry picked from commit cfe8b88)

# Conflicts:
#	internal/state/store.go
#	internal/store/store.go
#	node/node.go
@mergify mergify bot requested a review from a team as a code owner February 16, 2024 13:43
@mergify mergify bot requested a review from a team February 16, 2024 13:43
@mergify mergify bot added the conflicts label Feb 16, 2024
@jmalicevic jmalicevic self-assigned this Feb 22, 2024
@jmalicevic
Copy link
Collaborator

@Mergifyio refresh

@mergify
Copy link
Contributor Author

mergify bot commented Feb 23, 2024

refresh

✅ Pull request refreshed

@jmalicevic jmalicevic merged commit 0fa6d9a into v1.x Feb 23, 2024
@jmalicevic jmalicevic deleted the mergify/bp/v1.x/pr-1972 branch February 23, 2024 11:25
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.

1 participant