mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
aof.c: improve indentation and change warning message.
Related to #5201. I removed the !!! Warning part since compared to the other errors, a missing EXEC is in theory a normal happening in the AOF file, at least in theory: may happen in a differnet number of situations, and it's probably better to don't give the user the feeling that something really bad happened.
This commit is contained in:
parent
1a476b69ad
commit
db86dfb985
15
src/aof.c
15
src/aof.c
@ -778,7 +778,9 @@ int loadAppendOnlyFile(char *filename) {
|
|||||||
/* Command lookup */
|
/* Command lookup */
|
||||||
cmd = lookupCommand(argv[0]->ptr);
|
cmd = lookupCommand(argv[0]->ptr);
|
||||||
if (!cmd) {
|
if (!cmd) {
|
||||||
serverLog(LL_WARNING,"Unknown command '%s' reading the append only file", (char*)argv[0]->ptr);
|
serverLog(LL_WARNING,
|
||||||
|
"Unknown command '%s' reading the append only file",
|
||||||
|
(char*)argv[0]->ptr);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -786,14 +788,18 @@ int loadAppendOnlyFile(char *filename) {
|
|||||||
|
|
||||||
/* Run the command in the context of a fake client */
|
/* Run the command in the context of a fake client */
|
||||||
fakeClient->cmd = cmd;
|
fakeClient->cmd = cmd;
|
||||||
if (fakeClient->flags & CLIENT_MULTI && fakeClient->cmd->proc != execCommand) {
|
if (fakeClient->flags & CLIENT_MULTI &&
|
||||||
|
fakeClient->cmd->proc != execCommand)
|
||||||
|
{
|
||||||
queueMultiCommand(fakeClient);
|
queueMultiCommand(fakeClient);
|
||||||
} else {
|
} else {
|
||||||
cmd->proc(fakeClient);
|
cmd->proc(fakeClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The fake client should not have a reply */
|
/* The fake client should not have a reply */
|
||||||
serverAssert(fakeClient->bufpos == 0 && listLength(fakeClient->reply) == 0);
|
serverAssert(fakeClient->bufpos == 0 &&
|
||||||
|
listLength(fakeClient->reply) == 0);
|
||||||
|
|
||||||
/* The fake client should never get blocked */
|
/* The fake client should never get blocked */
|
||||||
serverAssert((fakeClient->flags & CLIENT_BLOCKED) == 0);
|
serverAssert((fakeClient->flags & CLIENT_BLOCKED) == 0);
|
||||||
|
|
||||||
@ -809,7 +815,8 @@ int loadAppendOnlyFile(char *filename) {
|
|||||||
* a short read, even if technically the protocol is correct: we want
|
* a short read, even if technically the protocol is correct: we want
|
||||||
* to remove the unprocessed tail and continue. */
|
* to remove the unprocessed tail and continue. */
|
||||||
if (fakeClient->flags & CLIENT_MULTI) {
|
if (fakeClient->flags & CLIENT_MULTI) {
|
||||||
serverLog(LL_WARNING,"!!! Warning: we lost EXEC in the middle of transaction, discard !!!");
|
serverLog(LL_WARNING,
|
||||||
|
"Revert incomplete MULTI/EXEC transaction in AOF file");
|
||||||
valid_up_to = valid_before_multi;
|
valid_up_to = valid_before_multi;
|
||||||
goto uxeof;
|
goto uxeof;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user