diff --git a/src/server.cpp b/src/server.cpp index d95e207dc..4e4418b02 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1836,7 +1836,7 @@ void databasesCron(bool fMainThread) { serverAssert(serverTL->rehashCtl == nullptr); /* Are we async rehashing? And if so is it time to re-calibrate? */ /* The recalibration limit is a prime number to ensure balancing across threads */ - if (rehashes_per_ms > 0 && async_rehashes < 131) { + if (rehashes_per_ms > 0 && async_rehashes < 131 && cserver.active_defrag_enabled) { serverTL->rehashCtl = dictRehashAsyncStart(g_pserver->db[rehash_db].dict, rehashes_per_ms); ++async_rehashes; } @@ -1858,7 +1858,9 @@ void databasesCron(bool fMainThread) { if (rehashes_per_ms > 0) { /* If the function did some work, stop here, we'll do * more at the next cron loop. */ - serverLog(LL_VERBOSE, "Calibrated rehashes per ms: %d", rehashes_per_ms); + if (!cserver.active_defrag_enabled) { + serverLog(LL_VERBOSE, "Calibrated rehashes per ms: %d", rehashes_per_ms); + } break; } else if (g_pserver->db[rehash_db].dict->asyncdata == nullptr) { /* If this db didn't need rehash and we have none in flight, we'll try the next one. */