Disable multithreaded rehash when active defrag is enabled. The two are not compatible
Former-commit-id: 56addcd17262ffbaefea26c0097cde53c616ece2
This commit is contained in:
parent
1b3dc3d422
commit
662fc28fdc
@ -1836,7 +1836,7 @@ void databasesCron(bool fMainThread) {
|
|||||||
serverAssert(serverTL->rehashCtl == nullptr);
|
serverAssert(serverTL->rehashCtl == nullptr);
|
||||||
/* Are we async rehashing? And if so is it time to re-calibrate? */
|
/* 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 */
|
/* 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);
|
serverTL->rehashCtl = dictRehashAsyncStart(g_pserver->db[rehash_db].dict, rehashes_per_ms);
|
||||||
++async_rehashes;
|
++async_rehashes;
|
||||||
}
|
}
|
||||||
@ -1858,7 +1858,9 @@ void databasesCron(bool fMainThread) {
|
|||||||
if (rehashes_per_ms > 0) {
|
if (rehashes_per_ms > 0) {
|
||||||
/* If the function did some work, stop here, we'll do
|
/* If the function did some work, stop here, we'll do
|
||||||
* more at the next cron loop. */
|
* 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;
|
break;
|
||||||
} else if (g_pserver->db[rehash_db].dict->asyncdata == nullptr) {
|
} 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. */
|
/* If this db didn't need rehash and we have none in flight, we'll try the next one. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user