mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
Transactions: use discardTransaction() in EXEC implementation.
This commit is contained in:
parent
2f49734029
commit
02c269e27e
@ -131,10 +131,7 @@ void execCommand(redisClient *c) {
|
|||||||
if (c->flags & (REDIS_DIRTY_CAS|REDIS_DIRTY_EXEC)) {
|
if (c->flags & (REDIS_DIRTY_CAS|REDIS_DIRTY_EXEC)) {
|
||||||
addReply(c, c->flags & REDIS_DIRTY_EXEC ? shared.execaborterr :
|
addReply(c, c->flags & REDIS_DIRTY_EXEC ? shared.execaborterr :
|
||||||
shared.nullmultibulk);
|
shared.nullmultibulk);
|
||||||
freeClientMultiState(c);
|
discardTransaction(c);
|
||||||
initClientMultiState(c);
|
|
||||||
c->flags &= ~(REDIS_MULTI|REDIS_DIRTY_CAS|REDIS_DIRTY_EXEC);
|
|
||||||
unwatchAllKeys(c);
|
|
||||||
goto handle_monitor;
|
goto handle_monitor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,9 +161,7 @@ void execCommand(redisClient *c) {
|
|||||||
c->argv = orig_argv;
|
c->argv = orig_argv;
|
||||||
c->argc = orig_argc;
|
c->argc = orig_argc;
|
||||||
c->cmd = orig_cmd;
|
c->cmd = orig_cmd;
|
||||||
freeClientMultiState(c);
|
discardTransaction(c);
|
||||||
initClientMultiState(c);
|
|
||||||
c->flags &= ~(REDIS_MULTI|REDIS_DIRTY_CAS|REDIS_DIRTY_EXEC);
|
|
||||||
/* Make sure the EXEC command is always replicated / AOF, since we
|
/* Make sure the EXEC command is always replicated / AOF, since we
|
||||||
* always send the MULTI command (we can't know beforehand if the
|
* always send the MULTI command (we can't know beforehand if the
|
||||||
* next operations will contain at least a modification to the DB). */
|
* next operations will contain at least a modification to the DB). */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user