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

add guard track to database #4666

Merged

Conversation

wanderingbort
Copy link
Contributor

In addition to setting the size you can now set a minimum guard on the chain state db. If there is a db-growing operation called on controller while this guard is violated it will throw and the node should shutdown gracefully.

the config is:
chain-state-db-guard-size-mb defaulted to 1MiB

related to #4555

In addition to setting the size you can now set a minimum guard on the chain state db.  If there is a db-growing operation called on controller while this guard is violated it will throw and the node should dhutdown gracefully.

related to EOSIO#4555
Copy link
Contributor

@brianjohnson5972 brianjohnson5972 left a comment

Choose a reason for hiding this comment

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

One comment to address (second one was invalid)

@@ -19,6 +19,7 @@ const static auto default_reversible_cache_size = 340*1024*1024ll;/// 1MB * 340
const static auto default_state_dir_name = "state";
const static auto forkdb_filename = "forkdb.dat";
const static auto default_state_size = 1*1024*1024*1024ll;
const static auto default_state_guard_size = 512*1024ll;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is divided by 1024*1024 in chain_plugin, I'm guessing you are missing a *1024 here

@@ -341,6 +342,9 @@ void chain_plugin::plugin_initialize(const variables_map& options) {
if( options.count( "chain-state-db-size-mb" ))
my->chain_config->state_size = options.at( "chain-state-db-size-mb" ).as<uint64_t>() * 1024 * 1024;

if( options.count( "chain-state-db-guard-size-mb" ))
Copy link
Contributor

Choose a reason for hiding this comment

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

Forget this comment, missed it was a minimum size

Copy link
Contributor Author

Choose a reason for hiding this comment

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

although this is fair, it looks like I was intending the track to be 512k... hrm

@wanderingbort wanderingbort merged commit d167a8a into EOSIO:release/1.1 Jul 17, 2018
@wanderingbort wanderingbort deleted the feature/4555-db-warning-track branch July 17, 2018 13:31
@spartucus
Copy link
Contributor

image
Hi @wanderingbort , I set chain-state-db-size-mb = 10240, and didn't set chain-state-db-guard-size-mb in config.ini, but it seems that Out of Memory and shutdown accidentally, and make database dirty flag :( ,does this mean i have to set chain-state-db-guard-size-mb explicitly?

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.

5 participants