diff --git a/src/cluster.c b/src/cluster.c index 9d1f910b2..6527eb61f 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -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; } diff --git a/src/sentinel.c b/src/sentinel.c index e501ae379..2a2068eef 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -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;