diff --git a/nano/secure/ledger.cpp b/nano/secure/ledger.cpp index dcd9a0c632..0d3ab23af6 100644 --- a/nano/secure/ledger.cpp +++ b/nano/secure/ledger.cpp @@ -1249,7 +1249,8 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p if (!rocksdb_store->init_error ()) { - logger.info (nano::log::type::ledger, "Step 1 of 7: Converting blocks table"); + 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 = 20ms; store.block.for_each_par ( @@ -1272,9 +1273,10 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p } } }); - logger.info (nano::log::type::ledger, "Finished converting {} blocks", count.load ()); - logger.info (nano::log::type::ledger, "Step 2 of 7: Converting pending table"); + + table_size = store.count (store.tx_begin_read (), tables::pending); + logger.info (nano::log::type::ledger, "Step 2 of 7: Converting {} entries from pending table", table_size); count = 0; store.pending.for_each_par ( [&] (store::read_transaction const & /*unused*/, auto i, auto n) { @@ -1289,9 +1291,10 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p } } }); - logger.info (nano::log::type::ledger, "Finished converting {} entries", count.load ()); - logger.info (nano::log::type::ledger, "Step 3 of 7: Converting confirmation_height table"); + + table_size = store.count (store.tx_begin_read (), tables::confirmation_height); + logger.info (nano::log::type::ledger, "Step 3 of 7: Converting {} entries from confirmation_height table", table_size); count = 0; store.confirmation_height.for_each_par ( [&] (store::read_transaction const & /*unused*/, auto i, auto n) { @@ -1306,9 +1309,10 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p } } }); - logger.info (nano::log::type::ledger, "Finished converting {} entries", count.load ()); - logger.info (nano::log::type::ledger, "Step 4 of 7: Converting accounts table"); + + table_size = store.count (store.tx_begin_read (), tables::confirmation_height); + logger.info (nano::log::type::ledger, "Step 4 of 7: Converting {} entries from confirmation_height table", table_size); count = 0; store.account.for_each_par ( [&] (store::read_transaction const & /*unused*/, auto i, auto n) { @@ -1323,9 +1327,10 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p } } }); - logger.info (nano::log::type::ledger, "Finished converting {} entries", count.load ()); - logger.info (nano::log::type::ledger, "Step 5 of 7: Converting rep_weights table"); + + table_size = store.count (store.tx_begin_read (), tables::rep_weights); + logger.info (nano::log::type::ledger, "Step 5 of 7: Converting {} entries from rep_weights table", table_size); count = 0; store.rep_weight.for_each_par ( [&] (store::read_transaction const & /*unused*/, auto i, auto n) { @@ -1340,9 +1345,10 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p } } }); - logger.info (nano::log::type::ledger, "Finished converting {} entries", count.load ()); - logger.info (nano::log::type::ledger, "Step 6 of 7: Converting pruned table"); + + table_size = store.count (store.tx_begin_read (), tables::pruned); + logger.info (nano::log::type::ledger, "Step 6 of 7: Converting {} entries from pruned table", table_size); count = 0; store.pruned.for_each_par ( [&] (store::read_transaction const & /*unused*/, auto i, auto n) { @@ -1357,9 +1363,10 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p } } }); - logger.info (nano::log::type::ledger, "Finished converting {} entries", count.load ()); - logger.info (nano::log::type::ledger, "Step 7 of 7: Converting final_votes table"); + + table_size = store.count (store.tx_begin_read (), tables::final_votes); + logger.info (nano::log::type::ledger, "Step 7 of 7: Converting {} entries from final_votes table", table_size); count = 0; store.final_vote.for_each_par ( [&] (store::read_transaction const & /*unused*/, auto i, auto n) {