Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Eixt nodeos gracefully if db size is smaller than snapshot size #10936

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ struct controller_impl {
"chainbase is at revision ${a}, but chain-kv is at revision ${b}", ("a", db.revision())("b", kv_db.revision()) );
this->shutdown = shutdown;
ilog( "Starting initialization from snapshot, this may take a significant amount of time" );
bool exception = false;
try {
snapshot->validate();
if( blog.head() ) {
Expand All @@ -528,10 +529,14 @@ struct controller_impl {
init(check_shutdown, true);
} catch (boost::interprocess::bad_alloc& e) {
elog( "db storage not configured to have enough storage for the provided snapshot, please increase and retry snapshot" );
throw e;
shutdown();
exception = true;
}

ilog( "Finished initialization from snapshot" );
if(!exception)
ilog ( "Finished initialization from snapshot" );
else
elog ( "Failed initialization from snapshot" );
}

void startup(std::function<void()> shutdown, std::function<bool()> check_shutdown, const genesis_state& genesis) {
Expand Down