From d23b8645f8384e9a2c6fe61db652e2e6ac692612 Mon Sep 17 00:00:00 2001 From: Neethu Haneesha Bingi Date: Tue, 7 Dec 2021 14:57:38 -0800 Subject: [PATCH] Enabling rocksdb metrics logger in simulation. --- fdbserver/KeyValueStoreRocksDB.actor.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fdbserver/KeyValueStoreRocksDB.actor.cpp b/fdbserver/KeyValueStoreRocksDB.actor.cpp index 635709960ee..cb17fb09743 100644 --- a/fdbserver/KeyValueStoreRocksDB.actor.cpp +++ b/fdbserver/KeyValueStoreRocksDB.actor.cpp @@ -267,10 +267,12 @@ struct RocksDBKeyValueStore : IKeyValueStore { a.done.sendError(statusToError(status)); } else { TraceEvent(SevInfo, "RocksDB").detail("Path", a.path).detail("Method", "Open"); - // The current thread and main thread are same when the code runs in simulation. - // blockUntilReady() is getting the thread into deadlock state, so avoiding the - // metric logger in simulation. - if (!g_network->isSimulated()) { + if (g_network->isSimulated()) { + // The current thread and main thread are same when the code runs in simulation. + // blockUntilReady() is getting the thread into deadlock state, so directly calling + // the metricsLogger. + a.metrics = rocksDBMetricLogger(options.statistics, db) && flowLockLogger(a.readLock, a.fetchLock); + } else { onMainThread([&] { a.metrics = rocksDBMetricLogger(options.statistics, db) && flowLockLogger(a.readLock, a.fetchLock);