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: ...@@ -5755,10 +5755,9 @@ socket_err:
/* Cleanup we want to do if no retry is attempted. */ /* Cleanup we want to do if no retry is attempted. */
zfree(ov); zfree(kv); zfree(ov); zfree(kv);
addReplySds(c, addReplyErrorSds(c, sdscatprintf(sdsempty(),
sdscatprintf(sdsempty(), "-IOERR error or timeout %s to target instance",
"-IOERR error or timeout %s to target instance\r\n", write_error ? "writing" : "reading"));
write_error ? "writing" : "reading"));
return; return;
} }
......
...@@ -3885,11 +3885,11 @@ NULL ...@@ -3885,11 +3885,11 @@ NULL
if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2])) == NULL) if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2])) == NULL)
return; return;
if (ri->flags & SRI_FAILOVER_IN_PROGRESS) { 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; return;
} }
if (sentinelSelectSlave(ri) == NULL) { if (sentinelSelectSlave(ri) == NULL) {
addReplySds(c,sdsnew("-NOGOODSLAVE No suitable replica to promote\r\n")); addReplyError(c,"-NOGOODSLAVE No suitable replica to promote");
return; return;
} }
serverLog(LL_WARNING,"Executing user requested FAILOVER of '%s'", serverLog(LL_WARNING,"Executing user requested FAILOVER of '%s'",
...@@ -3978,8 +3978,7 @@ NULL ...@@ -3978,8 +3978,7 @@ NULL
e = sdscat(e, "Not enough available Sentinels to reach the" e = sdscat(e, "Not enough available Sentinels to reach the"
" majority and authorize a failover"); " majority and authorize a failover");
} }
e = sdscat(e,"\r\n"); addReplyErrorSds(c,e);
addReplySds(c,e);
} }
} else if (!strcasecmp(c->argv[1]->ptr,"set")) { } else if (!strcasecmp(c->argv[1]->ptr,"set")) {
if (c->argc <= 3) goto numargserr; 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