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
3a4afb04
Commit
3a4afb04
authored
Jul 12, 2011
by
antirez
Browse files
Manual merge after cherry-pick
parent
63aed54a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/redis.c
View file @
3a4afb04
...
@@ -706,7 +706,7 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
...
@@ -706,7 +706,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)
...
@@ -1106,7 +1106,7 @@ int processCommand(redisClient *c) {
...
@@ -1106,7 +1106,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 @
3a4afb04
...
@@ -853,7 +853,7 @@ void vmReopenSwapFile(void);
...
@@ -853,7 +853,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 @
3a4afb04
...
@@ -1074,11 +1074,11 @@ void execBlockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd, int
...
@@ -1074,11 +1074,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