Giter Club home page Giter Club logo

Comments (1)

posvyatokum avatar posvyatokum commented on July 18, 2024

@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.

from nearcore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.