RREPLAY failures should be logged

Former-commit-id: 08b6a04055e950e53f043391ec9f9a09f654b1ee
This commit is contained in:
John Sully 2019-07-24 22:49:30 -04:00
parent f31b1fd06b
commit f3aa422a3f
3 changed files with 8 additions and 1 deletions

View File

@ -3279,9 +3279,14 @@ void replicaReplayCommand(client *c)
cFake->puser = c->puser;
cFake->querybuf = sdscatsds(cFake->querybuf,(sds)ptrFromObj(c->argv[2]));
selectDb(cFake, c->db->id);
auto ccmdPrev = serverTL->commandsExecuted;
processInputBuffer(cFake, (CMD_CALL_FULL & (~CMD_CALL_PROPAGATE)));
bool fExec = ccmdPrev != serverTL->commandsExecuted;
cFake->lock.unlock();
addReply(c, shared.ok);
if (fExec)
addReply(c, shared.ok);
else
addReplyError(c, "command did not execute");
freeClient(cFake);
serverTL->current_client = current_clientSave;

View File

@ -3347,6 +3347,7 @@ void call(client *c, int flags) {
dirty = g_pserver->dirty;
start = ustime();
c->cmd->proc(c);
serverTL->commandsExecuted++;
duration = ustime()-start;
dirty = g_pserver->dirty-dirty;
if (dirty < 0) dirty = 0;

View File

@ -1403,6 +1403,7 @@ struct redisServerThreadVars {
client *lua_client = nullptr; /* The "fake client" to query Redis from Lua */
struct fastlock lockPendingWrite;
char neterr[ANET_ERR_LEN]; /* Error buffer for anet.c */
long unsigned commandsExecuted = 0;
};
struct redisMaster {