From 1cbf85fdef2c7b7b98afb59b85ef0765f53a6130 Mon Sep 17 00:00:00 2001 From: Colin LeMahieu Date: Tue, 9 Jul 2024 17:58:51 +0100 Subject: [PATCH] Use default refresh interval. --- nano/secure/ledger.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/nano/secure/ledger.cpp b/nano/secure/ledger.cpp index 01d908cb44..b23b55aba4 100644 --- a/nano/secure/ledger.cpp +++ b/nano/secure/ledger.cpp @@ -1265,7 +1265,6 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p // Open rocksdb database nano::rocksdb_config rocksdb_config; rocksdb_config.enable = true; - //rocksdb_config.memory_multiplier = 4; auto rocksdb_store = nano::make_store (logger, data_path_a, nano::dev::constants, false, true, rocksdb_config); if (!rocksdb_store->init_error ()) @@ -1273,13 +1272,12 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p auto table_size = store.count (store.tx_begin_read (), tables::blocks); logger.info (nano::log::type::ledger, "Step 1 of 7: Converting {} million entries from blocks table", table_size / 1000000); std::atomic count = 0; - auto refresh_interval = 100ms; store.block.for_each_par ( [&] (store::read_transaction const & /*unused*/, auto i, auto n) { auto rocksdb_transaction (rocksdb_store->tx_begin_write ({}, { nano::tables::blocks })); for (; i != n; ++i) { - rocksdb_transaction.refresh_if_needed (refresh_interval); + rocksdb_transaction.refresh_if_needed (); std::vector vector; { nano::vectorstream stream (vector); @@ -1304,7 +1302,7 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p auto rocksdb_transaction (rocksdb_store->tx_begin_write ({}, { nano::tables::pending })); for (; i != n; ++i) { - rocksdb_transaction.refresh_if_needed (refresh_interval); + rocksdb_transaction.refresh_if_needed (); rocksdb_store->pending.put (rocksdb_transaction, i->first, i->second); if (auto count_l = ++count; count_l % 500000 == 0) { @@ -1322,7 +1320,7 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p auto rocksdb_transaction (rocksdb_store->tx_begin_write ({}, { nano::tables::confirmation_height })); for (; i != n; ++i) { - rocksdb_transaction.refresh_if_needed (refresh_interval); + rocksdb_transaction.refresh_if_needed (); rocksdb_store->confirmation_height.put (rocksdb_transaction, i->first, i->second); if (auto count_l = ++count; count_l % 500000 == 0) { @@ -1340,7 +1338,7 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p auto rocksdb_transaction (rocksdb_store->tx_begin_write ({}, { nano::tables::accounts })); for (; i != n; ++i) { - rocksdb_transaction.refresh_if_needed (refresh_interval); + rocksdb_transaction.refresh_if_needed (); rocksdb_store->account.put (rocksdb_transaction, i->first, i->second); if (auto count_l = ++count; count_l % 500000 == 0) { @@ -1358,7 +1356,7 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p auto rocksdb_transaction (rocksdb_store->tx_begin_write ({}, { nano::tables::rep_weights })); for (; i != n; ++i) { - rocksdb_transaction.refresh_if_needed (refresh_interval); + rocksdb_transaction.refresh_if_needed (); rocksdb_store->rep_weight.put (rocksdb_transaction, i->first, i->second.number ()); if (auto count_l = ++count; count_l % 500000 == 0) { @@ -1376,7 +1374,7 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p auto rocksdb_transaction (rocksdb_store->tx_begin_write ({}, { nano::tables::pruned })); for (; i != n; ++i) { - rocksdb_transaction.refresh_if_needed (refresh_interval); + rocksdb_transaction.refresh_if_needed (); rocksdb_store->pruned.put (rocksdb_transaction, i->first); if (auto count_l = ++count; count_l % 500000 == 0) {