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
891f9196
Commit
891f9196
authored
Jul 12, 2011
by
antirez
Browse files
Manual merge after cherry-pick
parent
59aecb3a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/redis.c
View file @
891f9196
...
@@ -677,7 +677,7 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
...
@@ -677,7 +677,7 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
readQueryFromClient
,
c
);
readQueryFromClient
,
c
);
cmd
=
lookupCommand
(
c
->
argv
[
0
]
->
ptr
);
cmd
=
lookupCommand
(
c
->
argv
[
0
]
->
ptr
);
redisAssert
(
cmd
!=
NULL
);
redisAssert
(
cmd
!=
NULL
);
call
(
c
,
cmd
);
call
(
c
);
resetClient
(
c
);
resetClient
(
c
);
/* There may be more data to process in the input buffer. */
/* There may be more data to process in the input buffer. */
if
(
c
->
querybuf
&&
sdslen
(
c
->
querybuf
)
>
0
)
if
(
c
->
querybuf
&&
sdslen
(
c
->
querybuf
)
>
0
)
...
@@ -1067,7 +1067,7 @@ int processCommand(redisClient *c) {
...
@@ -1067,7 +1067,7 @@ int processCommand(redisClient *c) {
addReply
(
c
,
shared
.
queued
);
addReply
(
c
,
shared
.
queued
);
}
else
{
}
else
{
if
(
server
.
vm_enabled
&&
server
.
vm_max_threads
>
0
&&
if
(
server
.
vm_enabled
&&
server
.
vm_max_threads
>
0
&&
blockClientOnSwappedKeys
(
c
,
cmd
))
return
REDIS_ERR
;
blockClientOnSwappedKeys
(
c
))
return
REDIS_ERR
;
call
(
c
);
call
(
c
);
}
}
return
REDIS_OK
;
return
REDIS_OK
;
...
...
src/redis.h
View file @
891f9196
...
@@ -820,7 +820,7 @@ void vmReopenSwapFile(void);
...
@@ -820,7 +820,7 @@ void vmReopenSwapFile(void);
int
vmFreePage
(
off_t
page
);
int
vmFreePage
(
off_t
page
);
void
zunionInterBlockClientOnSwappedKeys
(
redisClient
*
c
,
struct
redisCommand
*
cmd
,
int
argc
,
robj
**
argv
);
void
zunionInterBlockClientOnSwappedKeys
(
redisClient
*
c
,
struct
redisCommand
*
cmd
,
int
argc
,
robj
**
argv
);
void
execBlockClientOnSwappedKeys
(
redisClient
*
c
,
struct
redisCommand
*
cmd
,
int
argc
,
robj
**
argv
);
void
execBlockClientOnSwappedKeys
(
redisClient
*
c
,
struct
redisCommand
*
cmd
,
int
argc
,
robj
**
argv
);
int
blockClientOnSwappedKeys
(
redisClient
*
c
,
struct
redisCommand
*
cmd
);
int
blockClientOnSwappedKeys
(
redisClient
*
c
);
int
dontWaitForSwappedKey
(
redisClient
*
c
,
robj
*
key
);
int
dontWaitForSwappedKey
(
redisClient
*
c
,
robj
*
key
);
void
handleClientsBlockedOnSwappedKey
(
redisDb
*
db
,
robj
*
key
);
void
handleClientsBlockedOnSwappedKey
(
redisDb
*
db
,
robj
*
key
);
vmpointer
*
vmSwapObjectBlocking
(
robj
*
val
);
vmpointer
*
vmSwapObjectBlocking
(
robj
*
val
);
...
...
src/vm.c
View file @
891f9196
...
@@ -1064,11 +1064,11 @@ void execBlockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd, int
...
@@ -1064,11 +1064,11 @@ void execBlockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd, int
*
*
* Return 1 if the client is marked as blocked, 0 if the client can
* Return 1 if the client is marked as blocked, 0 if the client can
* continue as the keys it is going to access appear to be in memory. */
* continue as the keys it is going to access appear to be in memory. */
int
blockClientOnSwappedKeys
(
redisClient
*
c
,
struct
redisCommand
*
cmd
)
{
int
blockClientOnSwappedKeys
(
redisClient
*
c
)
{
if
(
cmd
->
vm_preload_proc
!=
NULL
)
{
if
(
c
->
cmd
->
vm_preload_proc
!=
NULL
)
{
cmd
->
vm_preload_proc
(
c
,
cmd
,
c
->
argc
,
c
->
argv
);
c
->
cmd
->
vm_preload_proc
(
c
,
c
->
cmd
,
c
->
argc
,
c
->
argv
);
}
else
{
}
else
{
waitForMultipleSwappedKeys
(
c
,
cmd
,
c
->
argc
,
c
->
argv
);
waitForMultipleSwappedKeys
(
c
,
c
->
cmd
,
c
->
argc
,
c
->
argv
);
}
}
/* If the client was blocked for at least one key, mark it as blocked. */
/* If the client was blocked for at least one key, mark it as blocked. */
...
...
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