Skip to content

Commit

Permalink
Clean up and align logging output
Browse files Browse the repository at this point in the history
  • Loading branch information
RickiNano committed Jul 9, 2024
1 parent 8191ce7 commit 14c0217
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nano/secure/ledger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1244,13 +1244,13 @@ 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 ())
{
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);
logger.info (nano::log::type::ledger, "Step 1 of 7: Converting {} entries from blocks table", table_size);
std::atomic<std::size_t> count = 0;
auto refresh_interval = 100ms;
store.block.for_each_par (
Expand All @@ -1269,7 +1269,7 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (std::filesystem::path const & data_p

if (auto count_l = ++count; count_l % 5000000 == 0)
{
logger.info (nano::log::type::ledger, "{} million blocks converted", count_l / 1000000);
logger.info (nano::log::type::ledger, "{} blocks converted", count_l);
}
}
});
Expand Down Expand Up @@ -1383,7 +1383,7 @@ 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, "Finalizing migration...");
logger.info (nano::log::type::ledger, "Finalizing and verifying migration...");
auto lmdb_transaction (store.tx_begin_read ());
auto version = store.version.get (lmdb_transaction);
auto rocksdb_transaction (rocksdb_store->tx_begin_write ());
Expand Down

0 comments on commit 14c0217

Please sign in to comment.