mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 00:52:38 +00:00
Use a safe iterator while saving the DB, since the getExpire() function will access the iterating dictionary.
This commit is contained in:
parent
4ec8b732b7
commit
25e805b417
@ -348,7 +348,7 @@ int rewriteAppendOnlyFile(char *filename) {
|
|||||||
redisDb *db = server.db+j;
|
redisDb *db = server.db+j;
|
||||||
dict *d = db->dict;
|
dict *d = db->dict;
|
||||||
if (dictSize(d) == 0) continue;
|
if (dictSize(d) == 0) continue;
|
||||||
di = dictGetIterator(d);
|
di = dictGetSafeIterator(d);
|
||||||
if (!di) {
|
if (!di) {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return REDIS_ERR;
|
return REDIS_ERR;
|
||||||
|
@ -427,7 +427,7 @@ int rdbSave(char *filename) {
|
|||||||
redisDb *db = server.db+j;
|
redisDb *db = server.db+j;
|
||||||
dict *d = db->dict;
|
dict *d = db->dict;
|
||||||
if (dictSize(d) == 0) continue;
|
if (dictSize(d) == 0) continue;
|
||||||
di = dictGetIterator(d);
|
di = dictGetSafeIterator(d);
|
||||||
if (!di) {
|
if (!di) {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return REDIS_ERR;
|
return REDIS_ERR;
|
||||||
|
Loading…
Reference in New Issue
Block a user