mirror of https://mirror.osredm.com/root/redis.git
Fix kvstore unable to push resize_cursor for resize when dict is NULL (#13031)
When the dict is NULL, we also need to push resize_cursor, otherwise it will keep doing useless continue here, and there is no way to resize the other dict behind it. Introduced in #12822. --------- Co-authored-by: Oran Agra <oran@redislabs.com>
This commit is contained in:
parent
8cd62f82ca
commit
84fd745d65
|
@ -578,9 +578,7 @@ void kvstoreTryResizeDicts(kvstore *kvs, int limit) {
|
||||||
for (int i = 0; i < limit; i++) {
|
for (int i = 0; i < limit; i++) {
|
||||||
int didx = kvs->resize_cursor;
|
int didx = kvs->resize_cursor;
|
||||||
dict *d = kvstoreGetDict(kvs, didx);
|
dict *d = kvstoreGetDict(kvs, didx);
|
||||||
if (!d)
|
if (d && dictShrinkIfNeeded(d) == DICT_ERR) {
|
||||||
continue;
|
|
||||||
if (dictShrinkIfNeeded(d) == DICT_ERR) {
|
|
||||||
dictExpandIfNeeded(d);
|
dictExpandIfNeeded(d);
|
||||||
}
|
}
|
||||||
kvs->resize_cursor = (didx + 1) % kvs->num_dicts;
|
kvs->resize_cursor = (didx + 1) % kvs->num_dicts;
|
||||||
|
|
Loading…
Reference in New Issue