Modules: Test MULTI/EXEC replication of RM_Replicate

Makse sure call() doesn't wrap replicated commands with
a redundant MULTI/EXEC

Other, unrelated changes:
1. Formatting compiler warning in INFO CLIENTS
2. Use CLIENT_ID_AOF instead of UINT64_MAX
This commit is contained in:
Guy Benoish
2020-03-29 13:08:21 +03:00
parent 4379b8b411
commit d6eb3afd13
6 changed files with 49 additions and 9 deletions

View File

@ -373,13 +373,16 @@ void addReplyErrorLength(client *c, const char *s, size_t len) {
* will produce an error. However it is useful to log such events since
* they are rare and may hint at errors in a script or a bug in Redis. */
int ctype = getClientType(c);
if (ctype == CLIENT_TYPE_MASTER || ctype == CLIENT_TYPE_SLAVE) {
char* to = ctype == CLIENT_TYPE_MASTER? "master": "replica";
char* from = ctype == CLIENT_TYPE_MASTER? "replica": "master";
if (ctype == CLIENT_TYPE_MASTER || ctype == CLIENT_TYPE_SLAVE || c->id == CLIENT_ID_AOF) {
char* to = c->id == CLIENT_ID_AOF ? "AOF-client" :
ctype == CLIENT_TYPE_MASTER ? "master" : "replica";
char* from = c->id == CLIENT_ID_AOF ? "server" :
ctype == CLIENT_TYPE_MASTER ? "replica" : "master";
char *cmdname = c->lastcmd ? c->lastcmd->name : "<unknown>";
serverLog(LL_WARNING,"== CRITICAL == This %s is sending an error "
"to its %s: '%s' after processing the command "
"'%s'", from, to, s, cmdname);
server.stat_unexpected_error_replies++;
}
}