-
Notifications
You must be signed in to change notification settings - Fork 264
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
Add an alternative to DeleteVersions that leaves no garbage #324
Conversation
DeleteVersionsTo deletes all versions below the given height
Thanks for contributing! I see you're still making changes to this, and that there are a few linter issues. Let me know when it's ready for review! Also, maybe convert this to a draft until it's ready. |
I see linter crashing in CI / CD config, updated to 1.28 and added I finished making changes, you can proceed to check! @erikgrinaker |
Finished! |
@erikgrinaker, I added an alternative, can you check both of them? klim0v/iavl@6933e53...82251d8 |
I also suggest to mark the DeleteVersions method as deprecated and try to pass sorted versions from it to the DeleteVersionsInterval. |
@alexanderbez, how do you like it? |
I've backported a bunch of linter fixes from I'd be interested to find out exactly what this garbage you see left behind by Since |
Checks that we don't leave behind any junk in the database, as reported in #324.
Ok, great - did it help with the performance though? I suspect using |
Yes, it helped! Now I'm looking for an explanation of why this happened. |
I suppose Seek() could be slow due to the need to go through the entire tree to make sure there is no such key. |
Great! It may be that |
Yes, but I can't yet confirm my words with performance tests to describe this problem... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR includes a bunch of noisy formatting changes, it would be nice to avoid these since they're unrelated to the main change.
Also, I've released new versions of tm-db and updated the 0.15 and 0.14 branches of IAVL.
Done ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff, thank you for this! Suggested a few minor nitpicks, otherwise LGTM!
I have added your recommendations, thanks! |
* fix: constant overflow when compiling for 32bit machines (cosmos#318) on Go 1.x(x) all constants are ints by default which causing build for 32bit machines to fail due to overflow golang/go#23086 Signed-off-by: Artur Troian <troian.ap@gmail.com> * changelog: release 0.14.2 * lint: update golangci-lint to 1.29 (cosmos#297) * ci: freeze golangci action version (cosmos#303) * github: bump golangci-lint and fix linter issues (cosmos#325) * test: check stray database entries in TestRandomOperations (cosmos#326) Checks that we don't leave behind any junk in the database, as reported in cosmos#324. * revert Protobuf methods accidentally cherry-picked in a41e36b * go.mod: bump tm-db to 0.5.2 * fix DeleteVersions stray orphans, and add DeleteVersionsRange (cosmos#324) * test: add TestRandomOperations case for DeleteVersions * test: run slow tests without race detector in CI (cosmos#338) * changelog: release 0.14.3 (cosmos#333) Co-authored-by: Artur Troian <troian@users.noreply.github.com> Co-authored-by: Erik Grinaker <erik@interchain.berlin> Co-authored-by: Marko <marbar3778@yahoo.com> Co-authored-by: Klimov Sergey <klim0v-sergey@yandex.ru>
The beginning of this issue is that the DeleteVersions method leaves behind a lot of dirty information, which leads to an increase in storage used by the storage.
I first added a method to remove versions up to a certain height, and now I have expanded it to allow removal within a given range.