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

Make Export Less RAM Intensive (IAVL Changes) #2953

Closed
czarcas7ic opened this issue Oct 5, 2022 · 11 comments
Closed

Make Export Less RAM Intensive (IAVL Changes) #2953

czarcas7ic opened this issue Oct 5, 2022 · 11 comments

Comments

@czarcas7ic
Copy link
Member

Background

It currently takes VMs with 64GB of RAM to export/import full state exports. Some basic IAVL improvements can be done to improve this performance.

Suggested Design

  • Key format change
    • Replace all native maps with BTree maps
  • We currently have atmoic writes at a per module scope, which is not efficient
    • We should lower the scope of atomic writes from the 100s of MBs to the 100s of KBs

Acceptance Criteria

  • Import/Export does not take extraordinary amounts of RAM to work
@catShaark
Copy link
Contributor

catShaark commented Oct 10, 2022

Can I have some questions ?

@catShaark
Copy link
Contributor

catShaark commented Oct 11, 2022

We currently have atomic writes at a per module scope

This refers to cms Store's Write() right ? Can you explain this more ?

@czarcas7ic
Copy link
Member Author

I am going to have to have a separate conversation with Dev to get a better / more concrete understanding of the best way forward with this. This might have to happen later this week sadly

@catShaark
Copy link
Contributor

seems like the non-atomic writes is explained here

@catShaark
Copy link
Contributor

@czarcas7ic, do we have any update on this?

@czarcas7ic
Copy link
Member Author

I sadly do not have context on this, @ValarDragon would you be able to write something out in order to allow @catShaark to pick up this task?

@ValarDragon
Copy link
Member

ValarDragon commented Nov 1, 2022

Key Format Changes

Basically make key formats we write to disk follow write_version | path_to_node

Replace all native maps with BTree maps

This is entirely unrelated

We currently have atmoic writes at a per module scope, which is not efficient

Basically just change the batch.set & batch.writeSync usage in IAVL, to write in many smaller batches. E.g. write every 1MB atomically, don't keep growing the batches. We already have tooling for detecting when we've completed the final write, the whole thing should not be atomic, it should just be possible to safely automatically rollback / wipe latest version.

@p0mvn
Copy link
Member

p0mvn commented Nov 1, 2022

@catShaark I would love to work with you on smaller batch writing. Would you be interested in working together?

@catShaark
Copy link
Contributor

yesss, just tell me what to do

@tac0turtle
Copy link
Contributor

why not streaming of genesis? agree that batching would help but also streaming would be the correct solution

@ValarDragon
Copy link
Member

Unneeded due to in-place testnet

@github-project-automation github-project-automation bot moved this from Needs Triage 🔍 to Done ✅ in Osmosis Chain Development Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

5 participants