Unverified Commit 84fd745d authored by Binbin's avatar Binbin Committed by GitHub
Browse files

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: default avatarOran Agra <oran@redislabs.com>
parent 8cd62f82
......@@ -578,9 +578,7 @@ void kvstoreTryResizeDicts(kvstore *kvs, int limit) {
for (int i = 0; i < limit; i++) {
int didx = kvs->resize_cursor;
dict *d = kvstoreGetDict(kvs, didx);
if (!d)
continue;
if (dictShrinkIfNeeded(d) == DICT_ERR) {
if (d && dictShrinkIfNeeded(d) == DICT_ERR) {
dictExpandIfNeeded(d);
}
kvs->resize_cursor = (didx + 1) % kvs->num_dicts;
......
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