mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 20:19:34 +00:00
Merge pull request #4256
d6fc870
db_lmdb: resize blockchain database when 90% filled (moneromooo-monero)
This commit is contained in:
commit
46bcd91db4
2 changed files with 3 additions and 7 deletions
|
@ -545,8 +545,8 @@ bool BlockchainLMDB::need_resize(uint64_t threshold_size) const
|
||||||
LOG_PRINT_L1("Space used: " << size_used);
|
LOG_PRINT_L1("Space used: " << size_used);
|
||||||
LOG_PRINT_L1("Space remaining: " << mei.me_mapsize - size_used);
|
LOG_PRINT_L1("Space remaining: " << mei.me_mapsize - size_used);
|
||||||
LOG_PRINT_L1("Size threshold: " << threshold_size);
|
LOG_PRINT_L1("Size threshold: " << threshold_size);
|
||||||
float resize_percent_old = RESIZE_PERCENT;
|
float resize_percent = RESIZE_PERCENT;
|
||||||
LOG_PRINT_L1(boost::format("Percent used: %.04f Percent threshold: %.04f") % ((double)size_used/mei.me_mapsize) % resize_percent_old);
|
LOG_PRINT_L1(boost::format("Percent used: %.04f Percent threshold: %.04f") % ((double)size_used/mei.me_mapsize) % resize_percent);
|
||||||
|
|
||||||
if (threshold_size > 0)
|
if (threshold_size > 0)
|
||||||
{
|
{
|
||||||
|
@ -559,10 +559,6 @@ bool BlockchainLMDB::need_resize(uint64_t threshold_size) const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::mt19937 engine(std::random_device{}());
|
|
||||||
std::uniform_real_distribution<double> fdis(0.6, 0.9);
|
|
||||||
double resize_percent = fdis(engine);
|
|
||||||
|
|
||||||
if ((double)size_used / mei.me_mapsize > resize_percent)
|
if ((double)size_used / mei.me_mapsize > resize_percent)
|
||||||
{
|
{
|
||||||
LOG_PRINT_L1("Threshold met (percent-based)");
|
LOG_PRINT_L1("Threshold met (percent-based)");
|
||||||
|
|
|
@ -449,7 +449,7 @@ private:
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
constexpr static float RESIZE_PERCENT = 0.8f;
|
constexpr static float RESIZE_PERCENT = 0.9f;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace cryptonote
|
} // namespace cryptonote
|
||||||
|
|
Loading…
Reference in a new issue