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

[Forknet] Support split storage nodes in mirror mocknet test #10581

Open
3 tasks
Tracked by #10542
posvyatokum opened this issue Feb 7, 2024 · 2 comments
Open
3 tasks
Tracked by #10542

[Forknet] Support split storage nodes in mirror mocknet test #10581

posvyatokum opened this issue Feb 7, 2024 · 2 comments
Assignees

Comments

@posvyatokum
Copy link
Member

posvyatokum commented Feb 7, 2024

Goal

Be able to test scenarios that include split storage archival nodes. The first such scenario is testing resharding before release 1.37 goes to mainnet.

Tasks

Preview Give feedback
  1. Node
    posvyatokum
@posvyatokum
Copy link
Member Author

@marcelo-gonzalez I drafted a fix for starting split storage from genesis in this branch master...split-storage-on-genesis and I want you to test it in mocknet.

As it is a prod fix, I was focusing on a real-life scenario of starting split storage node from scratch.
So, for mocknet usage we still need to perform (some) extra steps. I tested this configuration as follows:

  1. Created a node with big cold db
  2. Pointed hot db (.store.path in config.json) to a new directory
  3. Ran special tool to de-initialise cold db (while preserving data) neard cold-store -w make-cold-garbage (yes, we can technically change the name of this tool, but you will have to really convince me)
  4. Ran neard neard run
After that I saw that everything is ok

  1. Hot db was created and given DBKind Hot
  2. Genesis was loaded to hot db
  3. Cold loop started as a background process
  4. Cold loop looked at cold db and decided it needed initialisation
  5. Cold loop started copying all data from hot db to cold db
  6. Cold loop set cold height to genesis height

As I didn't invest much effort into creating good testing environment, I couldn't test that both node and cold loop will work without problems when in sync.

For mocknet it shouldn't matter which db you attach as cold. These tools do not look at cold db past some keys in BlockMisc column. And those keys are deleted right away via neard cold-store -w make-cold-garbage.
So, I suggest

  1. adding any cold disk to some mocknet nodes
  2. modifying config on those nodes https://near-nodes.io/archival/split-storage-archival#config
  3. running neard cold-store -w make-cold-garbage on them
  4. starting mocknet test as usual (from genesis)

We then want to see those nodes fail to create a snapshot for resharding.
Any cold migration is a background process. During usual mocknet flow we will stop the node once it loaded genesis and make a copy of db for fast future restart. We need to add backup for cold db as well. It will probably not be initialised at that point, but the node from backup will still start ok. Background loop will just begin copying everything from hot to cold as a first step after a reset.

@VanBarbascu
Copy link
Contributor

VanBarbascu commented Jan 27, 2025

In the current setup for the archival node, we spwan an RPC node.
Current limitation is that we do not support backups for archival node.

TODO:

  • On top of the RPC configs add configs for archival node. "archive": true, "save_trie_changes": true, "split_storage": { "enable_split_storage_view_client": true }, "cold_store": { "path": "/home/ubuntu/.near/cold" },
  • In infra-ops, attach a new disk to the archival node and use that one.

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

No branches or pull requests

3 participants