nano-node
nano-node copied to clipboard
Assert in nano::rocksdb::store::clear()
I hit this assert whilst running a unit test.
[ RUN ] active_transactions.fork_replacement_tally
Assertion (status.ok ()) failed
int nano::rocksdb::store::clear(rocksdb::ColumnFamilyHandle*)
/home/ds/CLionProjects/work/nano/node/rocksdb/rocksdb.cpp:602
This is the function that contains the assert statement:
int nano::rocksdb::store::clear (::rocksdb::ColumnFamilyHandle * column_family)
{
// Dropping completely removes the column
auto name = column_family->GetName ();
auto status = db->DropColumnFamily (column_family);
release_assert (status.ok ());
// Need to add it back as we just want to clear the contents
auto handle_it = std::find_if (handles.begin (), handles.end (), [column_family] (auto & handle) {
return handle.get () == column_family;
});
debug_assert (handle_it != handles.cend ());
status = db->CreateColumnFamily (get_cf_options (name), name, &column_family);
release_assert (status.ok ());
handle_it->reset (column_family);
return status.code ();
}
It appears to be deleting something and then trying to add it back again. That sounds racy... it possibly needs thread protection.
This issue has been fixed by brandon-bb and can be closed @qwahzi
This issue has been fixed by brandon-bb and can be closed @qwahzi
Thank you Ricki and Brandon!