diff --git a/src/storage/rocksdbfactory.cpp b/src/storage/rocksdbfactory.cpp index 6a551c28b..8e6ecd0d5 100644 --- a/src/storage/rocksdbfactory.cpp +++ b/src/storage/rocksdbfactory.cpp @@ -169,12 +169,14 @@ IStorage *RocksDBStorageFactory::create(int db, key_load_iterator iter, void *pr std::unique_ptr it = std::unique_ptr(m_spdb->NewIterator(opts, spcolfamily.get())); it->SeekToFirst(); - if (fUnclean && it->Valid()) - printf("\tDatabase was not shutdown cleanly, recomputing metrics\n"); + bool fFirstRealKey = true; for (;it->Valid(); it->Next()) { if (FInternalKey(it->key().data(), it->key().size())) continue; + if (fUnclean && it->Valid() && fFirstRealKey) + printf("\tDatabase %d was not shutdown cleanly, recomputing metrics\n", db); + fFirstRealKey = false; if (iter != nullptr) iter(it->key().data(), it->key().size(), privdata); ++count;