mirror of
https://github.com/fluencelabs/redis
synced 2025-05-05 23:42:14 +00:00
Merge pull request #296 from pietern/2.4-expirefix
Don't expire keys when loading an RDB after a SYNC
This commit is contained in:
commit
58bfbd1fa4
@ -993,8 +993,12 @@ int rdbLoad(char *filename) {
|
|||||||
if ((key = rdbLoadStringObject(fp)) == NULL) goto eoferr;
|
if ((key = rdbLoadStringObject(fp)) == NULL) goto eoferr;
|
||||||
/* Read value */
|
/* Read value */
|
||||||
if ((val = rdbLoadObject(type,fp)) == NULL) goto eoferr;
|
if ((val = rdbLoadObject(type,fp)) == NULL) goto eoferr;
|
||||||
/* Check if the key already expired */
|
/* Check if the key already expired. This function is used when loading
|
||||||
if (expiretime != -1 && expiretime < now) {
|
* an RDB file from disk, either at startup, or when an RDB was
|
||||||
|
* received from the master. In the latter case, the master is
|
||||||
|
* responsible for key expiry. If we would expire keys here, the
|
||||||
|
* snapshot taken by the master may not be reflected on the slave. */
|
||||||
|
if (server.masterhost == NULL && expiretime != -1 && expiretime < now) {
|
||||||
decrRefCount(key);
|
decrRefCount(key);
|
||||||
decrRefCount(val);
|
decrRefCount(val);
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user