Skip to content

Perform v9 migration less-atomically#3

Merged
michaelsproul merged 4 commits intomichaelsproul:db-payload-separationfrom
paulhauner:payload-sep-paul
May 11, 2022
Merged

Perform v9 migration less-atomically#3
michaelsproul merged 4 commits intomichaelsproul:db-payload-separationfrom
paulhauner:payload-sep-paul

Conversation

@paulhauner
Copy link

Issue Addressed

Performs each block in the migration separately, rather than the entire operation. This helps to reduce the memory footprint of this operation from ~10GB to ~1GB.

Some new logic has been added to detect when a block has already been migrated, this allows recovery from a partial migration (e.g., Ctrl+C halfway through the migration).

I've swapped iterating the keys of the database rather than keys + values. This isn't strictly necessary and I'm not sure if it has an impact on memory usage, but I've kept it around since:

  1. Using keys allows us to re-use existing DB methods (e.g., try_get_full_block) rather than dealing with SSZ bytes directly.
  2. It seems cool to have the key iterator in the code for future migrations.

I'm not attached to the key iterator though, I could take it or leave it.

Copy link
Owner

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

V nice, thank you!

@michaelsproul michaelsproul merged commit ebdad89 into michaelsproul:db-payload-separation May 11, 2022
michaelsproul pushed a commit that referenced this pull request Nov 3, 2023
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