Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
58bfbd1f
Commit
58bfbd1f
authored
Jan 16, 2012
by
Salvatore Sanfilippo
Browse files
Merge pull request #296 from pietern/2.4-expirefix
Don't expire keys when loading an RDB after a SYNC
parents
8b8261ed
aa794ac0
Changes
1
Show whitespace changes
Inline
Side-by-side
src/rdb.c
View file @
58bfbd1f
...
@@ -993,8 +993,12 @@ int rdbLoad(char *filename) {
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment