Fix spurious warnings about unclean RocksDB databases on startup
This commit is contained in:
parent
eaea45656e
commit
574081644a
@ -169,12 +169,14 @@ IStorage *RocksDBStorageFactory::create(int db, key_load_iterator iter, void *pr
|
|||||||
std::unique_ptr<rocksdb::Iterator> it = std::unique_ptr<rocksdb::Iterator>(m_spdb->NewIterator(opts, spcolfamily.get()));
|
std::unique_ptr<rocksdb::Iterator> it = std::unique_ptr<rocksdb::Iterator>(m_spdb->NewIterator(opts, spcolfamily.get()));
|
||||||
|
|
||||||
it->SeekToFirst();
|
it->SeekToFirst();
|
||||||
if (fUnclean && it->Valid())
|
bool fFirstRealKey = true;
|
||||||
printf("\tDatabase was not shutdown cleanly, recomputing metrics\n");
|
|
||||||
|
|
||||||
for (;it->Valid(); it->Next()) {
|
for (;it->Valid(); it->Next()) {
|
||||||
if (FInternalKey(it->key().data(), it->key().size()))
|
if (FInternalKey(it->key().data(), it->key().size()))
|
||||||
continue;
|
continue;
|
||||||
|
if (fUnclean && it->Valid() && fFirstRealKey)
|
||||||
|
printf("\tDatabase %d was not shutdown cleanly, recomputing metrics\n", db);
|
||||||
|
fFirstRealKey = false;
|
||||||
if (iter != nullptr)
|
if (iter != nullptr)
|
||||||
iter(it->key().data(), it->key().size(), privdata);
|
iter(it->key().data(), it->key().size(), privdata);
|
||||||
++count;
|
++count;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user