Unverified Commit cf6ed3fe authored by zhaozhao.zz's avatar zhaozhao.zz Committed by GitHub
Browse files

fix the wrong judgement for activerehashing in standalone mode (#12741)

Introduced by #11695, the judgement should be dictIsRehashing.
parent 53294e53
...@@ -692,13 +692,13 @@ int incrementallyRehash(int dbid) { ...@@ -692,13 +692,13 @@ int incrementallyRehash(int dbid) {
} else { } else {
/* Rehash main dict. */ /* Rehash main dict. */
dict *main_dict = server.db[dbid].dict[0]; dict *main_dict = server.db[dbid].dict[0];
if (main_dict) { if (dictIsRehashing(main_dict)) {
dictRehashMilliseconds(main_dict, INCREMENTAL_REHASHING_THRESHOLD_MS); dictRehashMilliseconds(main_dict, INCREMENTAL_REHASHING_THRESHOLD_MS);
return 1; /* already used our millisecond for this loop... */ return 1; /* already used our millisecond for this loop... */
} }
/* Rehash expires. */ /* Rehash expires. */
dict *expires_dict = server.db[dbid].expires[0]; dict *expires_dict = server.db[dbid].expires[0];
if (expires_dict) { if (dictIsRehashing(expires_dict)) {
dictRehashMilliseconds(expires_dict, INCREMENTAL_REHASHING_THRESHOLD_MS); dictRehashMilliseconds(expires_dict, INCREMENTAL_REHASHING_THRESHOLD_MS);
return 1; /* already used our millisecond for this loop... */ return 1; /* already used our millisecond for this loop... */
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment