From 37a10cef028f0ed16e6768dabdd3ffa56fc77761 Mon Sep 17 00:00:00 2001 From: "zhaozhao.zz" Date: Fri, 22 Nov 2019 15:32:43 +0800 Subject: Propagation: wrap commands in also_propagate array with MULIT/EXEC Random command like SPOP with count is replicated as some SREM operations, and store them in also_propagate array to propagate after the call, but this would break atomicity. To keep the command's atomicity, wrap also_propagate array with MULTI/EXEC. --- src/server.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/server.h') diff --git a/src/server.h b/src/server.h index 5a95d4c14..22e484462 100644 --- a/src/server.h +++ b/src/server.h @@ -923,6 +923,7 @@ struct sharedObjectsStruct { *busykeyerr, *oomerr, *plus, *messagebulk, *pmessagebulk, *subscribebulk, *unsubscribebulk, *psubscribebulk, *punsubscribebulk, *del, *unlink, *rpop, *lpop, *lpush, *rpoplpush, *zpopmin, *zpopmax, *emptyscan, + *multi, *exec, *select[PROTO_SHARED_SELECT_CMDS], *integers[OBJ_SHARED_INTEGERS], *mbulkhdr[OBJ_SHARED_BULKHDR_LEN], /* "*\r\n" */ @@ -1751,6 +1752,7 @@ void touchWatchedKeysOnFlush(int dbid); void discardTransaction(client *c); void flagTransaction(client *c); void execCommandPropagateMulti(client *c); +void execCommandPropagateExec(client *c); /* Redis object implementation */ void decrRefCount(robj *o); -- cgit v1.2.1