Skip to content
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

Fix tree versions causing slow restart and OOM #41

Merged
merged 12 commits into from
Sep 17, 2024
Merged

Conversation

yzang2019
Copy link
Contributor

@yzang2019 yzang2019 commented Sep 11, 2024

Describe your changes and provide context

This PR fix a memory issue problem for archive node: currently during initialization, we have to scan all the IAVL tree and for each version, we need to mark wether that version exist or not in a version map[int]bool, doing this will cause the node OOM if we have hundreds of millions of versions

Fix: Referring to the latest open source fix, instead of using a version map, we simply store the first and last version.

Testing performed to validate your change

Tested in archive node:

  • Restart archive node time reduced from 1 hour -> 5 minutes
  • Memory usage reduced from 256GB -> 20GB

@yzang2019 yzang2019 merged commit ff17b34 into main Sep 17, 2024
3 checks passed
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.

2 participants