Unverified Commit aa6deff0 authored by DarrenJiang13's avatar DarrenJiang13 Committed by GitHub
Browse files

add missed error counting (#9646)

* add: add missed error counting in sentinel.c and cluster.c
parent 81095b1b
......@@ -5755,10 +5755,9 @@ socket_err:
/* Cleanup we want to do if no retry is attempted. */
zfree(ov); zfree(kv);
addReplySds(c,
sdscatprintf(sdsempty(),
"-IOERR error or timeout %s to target instance\r\n",
write_error ? "writing" : "reading"));
addReplyErrorSds(c, sdscatprintf(sdsempty(),
"-IOERR error or timeout %s to target instance",
write_error ? "writing" : "reading"));
return;
}
......
......@@ -3885,11 +3885,11 @@ NULL
if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2])) == NULL)
return;
if (ri->flags & SRI_FAILOVER_IN_PROGRESS) {
addReplySds(c,sdsnew("-INPROG Failover already in progress\r\n"));
addReplyError(c,"-INPROG Failover already in progress");
return;
}
if (sentinelSelectSlave(ri) == NULL) {
addReplySds(c,sdsnew("-NOGOODSLAVE No suitable replica to promote\r\n"));
addReplyError(c,"-NOGOODSLAVE No suitable replica to promote");
return;
}
serverLog(LL_WARNING,"Executing user requested FAILOVER of '%s'",
......@@ -3978,8 +3978,7 @@ NULL
e = sdscat(e, "Not enough available Sentinels to reach the"
" majority and authorize a failover");
}
e = sdscat(e,"\r\n");
addReplySds(c,e);
addReplyErrorSds(c,e);
}
} else if (!strcasecmp(c->argv[1]->ptr,"set")) {
if (c->argc <= 3) goto numargserr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment