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
48349690
Commit
48349690
authored
Oct 09, 2018
by
antirez
Browse files
Transactions: Use CMD_CLAL_NOQUEUE now that call() handles +QUEUED.
parent
71c37605
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/multi.c
View file @
48349690
...
@@ -158,7 +158,7 @@ void execCommand(client *c) {
...
@@ -158,7 +158,7 @@ void execCommand(client *c) {
must_propagate
=
1
;
must_propagate
=
1
;
}
}
call
(
c
,
CMD_CALL_FULL
);
call
(
c
,
CMD_CALL_FULL
|
CMD_CALL_NOQUEUE
);
/* Commands may alter argc/argv, restore mstate. */
/* Commands may alter argc/argv, restore mstate. */
c
->
mstate
.
commands
[
j
].
argc
=
c
->
argc
;
c
->
mstate
.
commands
[
j
].
argc
=
c
->
argc
;
...
...
src/scripting.c
View file @
48349690
...
@@ -560,7 +560,7 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
...
@@ -560,7 +560,7 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
}
}
/* Run the command */
/* Run the command */
int
call_flags
=
CMD_CALL_SLOWLOG
|
CMD_CALL_STATS
;
int
call_flags
=
CMD_CALL_SLOWLOG
|
CMD_CALL_STATS
|
CMD_CALL_NOQUEUE
;
if
(
server
.
lua_replicate_commands
)
{
if
(
server
.
lua_replicate_commands
)
{
/* Set flags according to redis.set_repl() settings. */
/* Set flags according to redis.set_repl() settings. */
if
(
server
.
lua_repl
&
PROPAGATE_AOF
)
if
(
server
.
lua_repl
&
PROPAGATE_AOF
)
...
...
src/server.c
View file @
48349690
...
@@ -2421,8 +2421,15 @@ void call(client *c, int flags) {
...
@@ -2421,8 +2421,15 @@ void call(client *c, int flags) {
/* If the client is in the context of a transaction, reply with
/* If the client is in the context of a transaction, reply with
* +QUEUED and just accumulate the command in the client transaction
* +QUEUED and just accumulate the command in the client transaction
* commands vector. */
* commands vector.
if
(
c
->
flags
&
CLIENT_MULTI
&&
*
* Note that CALL_NOQUEUE can override this check and execute the command
* straight away even if the client is in "MULTI" state. This is useful
* every time we want to actually execute commands even if the client is
* in MULTI state, like in scripting.c or in the implementation of EXEC
* itself. */
if
(
!
(
flags
&
CMD_CALL_NOQUEUE
)
&&
c
->
flags
&
CLIENT_MULTI
&&
c
->
cmd
->
proc
!=
execCommand
&&
c
->
cmd
->
proc
!=
discardCommand
&&
c
->
cmd
->
proc
!=
execCommand
&&
c
->
cmd
->
proc
!=
discardCommand
&&
c
->
cmd
->
proc
!=
multiCommand
&&
c
->
cmd
->
proc
!=
watchCommand
)
c
->
cmd
->
proc
!=
multiCommand
&&
c
->
cmd
->
proc
!=
watchCommand
)
{
{
...
...
src/server.h
View file @
48349690
...
@@ -416,6 +416,9 @@ typedef long long mstime_t; /* millisecond time type. */
...
@@ -416,6 +416,9 @@ typedef long long mstime_t; /* millisecond time type. */
#define CMD_CALL_PROPAGATE_REPL (1<<3)
#define CMD_CALL_PROPAGATE_REPL (1<<3)
#define CMD_CALL_PROPAGATE (CMD_CALL_PROPAGATE_AOF|CMD_CALL_PROPAGATE_REPL)
#define CMD_CALL_PROPAGATE (CMD_CALL_PROPAGATE_AOF|CMD_CALL_PROPAGATE_REPL)
#define CMD_CALL_FULL (CMD_CALL_SLOWLOG | CMD_CALL_STATS | CMD_CALL_PROPAGATE)
#define CMD_CALL_FULL (CMD_CALL_SLOWLOG | CMD_CALL_STATS | CMD_CALL_PROPAGATE)
/* --- call() special semantics that can be requested by the caller
* --- but are not included in CALL_FULL. */
#define CMD_CALL_NOQUEUE (1<<4)
/* Command propagation flags, see propagate() function */
/* Command propagation flags, see propagate() function */
#define PROPAGATE_NONE 0
#define PROPAGATE_NONE 0
...
...
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