This commit is contained in:
Piotr Wójcik 2024-08-26 20:04:49 +02:00
commit 9762eeb3e0
2 changed files with 7 additions and 0 deletions

View file

@ -257,6 +257,9 @@ void nano::store::lmdb::component::upgrade_v22_to_v23 (store::write_transaction
logger.info (nano::log::type::lmdb, "Upgrading database from v22 to v23...");
drop (transaction, tables::rep_weights);
transaction.refresh ();
release_assert (rep_weight.begin (tx_begin_read ()) == rep_weight.end (), "rep weights table must be empty before upgrading to v23");
const size_t batch_size = 1000 * 10;

View file

@ -293,6 +293,7 @@ void nano::store::rocksdb::component::upgrade_v22_to_v23 (store::write_transacti
{
logger.info (nano::log::type::rocksdb, "Dropping existing rep_weights table");
drop (transaction, tables::rep_weights);
transaction.refresh ();
}
{
@ -301,8 +302,11 @@ void nano::store::rocksdb::component::upgrade_v22_to_v23 (store::write_transacti
::rocksdb::ColumnFamilyHandle * new_cf_handle;
::rocksdb::Status status = db->CreateColumnFamily (new_cf_options, "rep_weights", &new_cf_handle);
handles.emplace_back (new_cf_handle);
transaction.refresh ();
}
release_assert (rep_weight.begin (tx_begin_read ()) == rep_weight.end (), "rep weights table must be empty before upgrading to v23");
const size_t batch_size = 1000 * 10;
nano::account next = 0;