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
7493d2a0
Commit
7493d2a0
authored
Mar 10, 2011
by
antirez
Browse files
fixed diskstore race condition
parent
dc75b1ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/dscache.c
View file @
7493d2a0
...
@@ -890,8 +890,16 @@ int waitForSwappedKey(redisClient *c, robj *key) {
...
@@ -890,8 +890,16 @@ int waitForSwappedKey(redisClient *c, robj *key) {
listAddNodeTail
(
l
,
c
);
listAddNodeTail
(
l
,
c
);
/* Are we already loading the key from disk? If not create a job */
/* Are we already loading the key from disk? If not create a job */
if
(
de
==
NULL
)
if
(
de
==
NULL
)
{
cacheScheduleIO
(
c
->
db
,
key
,
REDIS_IO_LOAD
);
int
flags
=
cacheScheduleIOGetFlags
(
c
->
db
,
key
);
/* It is possible that even if there are no clients waiting for
* a load operation, still we have a load operation in progress.
* For instance think to a client performing a GET and then
* closing the connection */
if
((
flags
&
(
REDIS_IO_LOAD
|
REDIS_IO_LOADINPROG
))
==
0
)
cacheScheduleIO
(
c
->
db
,
key
,
REDIS_IO_LOAD
);
}
return
1
;
return
1
;
}
}
...
...
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