Fix node auto-configuration code:

The `node_size` configuration option is used to automatically
configure various parameters (cache sizes, timeouts, etc) for
the server.

A previous commit included changes that caused incorrect values
to be returned which can result in sub-optimal performance that
can manifest as difficulty syncing to the network, or increased
disk I/O and/or memory usage. The problem was introduced with
commit 66fad62e66.

This commit, if merged, fixes the code to ensure that the correct
values are returned and introduces a compile-time check to prevent
this issue from reoccurring.
This commit is contained in:
Nik Bougalis
2019-12-14 16:30:04 -08:00
parent 63503ee8f0
commit 4bb951d48e
6 changed files with 123 additions and 88 deletions

View File

@@ -190,7 +190,7 @@ SHAMapStoreImp::SHAMapStoreImp(
if (!section.exists("cache_mb"))
{
section.set("cache_mb", std::to_string(
config.getSize(siHashNodeDBCache)));
config.getValueFor(SizedItem::hashNodeDBCache)));
}
if (!section.exists("filter_bits") && (config.NODE_SIZE >= 2))