Skip to content

Commit

Permalink
Merge pull request #6122 from neethuhaneesha/enableMetricsLogger
Browse files Browse the repository at this point in the history
Enabling rocksdb metrics logger in simulation.
  • Loading branch information
neethuhaneesha authored Dec 8, 2021
2 parents ffe5190 + d23b864 commit 50ed545
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fdbserver/KeyValueStoreRocksDB.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 50ed545

Please sign in to comment.