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

Rel.2.1.x: Exit nodeos if fork_db is corrupted and lib cannot advance #10170

Merged
merged 4 commits into from
Mar 23, 2021

Conversation

linhuang-blockone
Copy link
Contributor

Change Description

https://blockone.atlassian.net/browse/EPE-831

#10140 reports that nodeos gets stuck after restart due to a corrupt forkdb. When this happens, log_irreversible keeps throwing the same exception whenever it executes. The solution is to exit nodeos. Log detailed information to help future debugging.

Change Type

Select ONE:

  • Documentation
  • Stability bug fix
  • Other
  • Other - special case

Testing Changes

Select ANY that apply:

  • New Tests
  • Existing Tests
  • Test Framework
  • CI System
  • Other

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

libraries/chain/controller.cpp Outdated Show resolved Hide resolved
@@ -428,6 +428,9 @@ class producer_plugin_impl : public std::enable_shared_from_this<producer_plugin
chain_plugin::handle_bad_alloc();
} catch ( boost::interprocess::bad_alloc& ) {
chain_plugin::handle_db_exhaustion();
} catch ( const fork_database_exception& ) {
wlog("Cannot recover from fork_db exception. Shutting down.");
Copy link
Contributor

Choose a reason for hiding this comment

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

elog. Log the exception details. Add to the exception message the details you had in the log message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. Done.

Copy link
Contributor

Choose a reason for hiding this comment

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

Add to the EOS_ASSERT the details you had in the log message.

@linhuang-blockone linhuang-blockone changed the title Exit nodeos if fork_db is corrupted and lib cannot advance Rel.2.1.x: Exit nodeos if fork_db is corrupted and lib cannot advance Mar 23, 2021
@linhuang-blockone linhuang-blockone merged commit f3d894a into release/2.1.x Mar 23, 2021
@linhuang-blockone linhuang-blockone deleted the 2_1_x_exit_nodeos_if_fork_db_corrupt branch March 23, 2021 17:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants