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
1ad4d316
Commit
1ad4d316
authored
May 26, 2010
by
antirez
Browse files
Fix EXEC bug that was leaving the client in dirty status when used with WATCH
parent
bc000c1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
1ad4d316
...
...
@@ -7556,6 +7556,7 @@ static void execCommand(redisClient *c) {
execCommandReplicateMulti
(
c
);
/* Exec all the queued commands */
unwatchAllKeys
(
c
);
/* Unwatch ASAP otherwise we'll waste CPU cycles */
orig_argv
=
c
->
argv
;
orig_argc
=
c
->
argc
;
addReplySds
(
c
,
sdscatprintf
(
sdsempty
(),
"*%d
\r\n
"
,
c
->
mstate
.
count
));
...
...
@@ -7568,8 +7569,7 @@ static void execCommand(redisClient *c) {
c
->
argc
=
orig_argc
;
freeClientMultiState
(
c
);
initClientMultiState
(
c
);
c
->
flags
&=
(
~
REDIS_MULTI
);
unwatchAllKeys
(
c
);
c
->
flags
&=
~
(
REDIS_MULTI
|
REDIS_DIRTY_CAS
);
/* Make sure the EXEC command is always replicated / AOF, since we
* always send the MULTI command (we can't know beforehand if the
* next operations will contain at least a modification to the DB). */
...
...
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