Don't complain about unclean shutdowns with an empty database
Former-commit-id: 99f5c02e87062552eaa2f26e960eb7c9dd977c84
This commit is contained in:
parent
bfbdf23b1a
commit
e5a2edd641
@ -149,12 +149,15 @@ IStorage *RocksDBStorageFactory::create(int db, key_load_iterator iter, void *pr
|
|||||||
if (fUnclean || iter != nullptr)
|
if (fUnclean || iter != nullptr)
|
||||||
{
|
{
|
||||||
count = 0;
|
count = 0;
|
||||||
if (fUnclean)
|
|
||||||
printf("\tDatabase was not shutdown cleanly, recomputing metrics\n");
|
|
||||||
auto opts = rocksdb::ReadOptions();
|
auto opts = rocksdb::ReadOptions();
|
||||||
opts.tailing = true;
|
opts.tailing = true;
|
||||||
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()));
|
||||||
for (it->SeekToFirst(); it->Valid(); it->Next()) {
|
|
||||||
|
it->SeekToFirst();
|
||||||
|
if (fUnclean && it->Valid())
|
||||||
|
printf("\tDatabase was not shutdown cleanly, recomputing metrics\n");
|
||||||
|
|
||||||
|
for (;it->Valid(); it->Next()) {
|
||||||
if (FInternalKey(it->key().data(), it->key().size()))
|
if (FInternalKey(it->key().data(), it->key().size()))
|
||||||
continue;
|
continue;
|
||||||
if (iter != nullptr)
|
if (iter != nullptr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user