@@ -631,6 +632,7 @@ int loadAppendOnlyFile(char *filename) {
...
@@ -631,6 +632,7 @@ int loadAppendOnlyFile(char *filename) {
* If the client is in the middle of a MULTI/EXEC, log error and quit. */
* If the client is in the middle of a MULTI/EXEC, log error and quit. */
if(fakeClient->flags&REDIS_MULTI)gotouxeof;
if(fakeClient->flags&REDIS_MULTI)gotouxeof;
loaded_ok:/* DB loaded, cleanup and return REDIS_OK to the caller. */
fclose(fp);
fclose(fp);
freeFakeClient(fakeClient);
freeFakeClient(fakeClient);
server.aof_state=old_aof_state;
server.aof_state=old_aof_state;
...
@@ -646,7 +648,13 @@ readerr: /* Read error. If feof(fp) is true, fall through to unexpected EOF. */
...
@@ -646,7 +648,13 @@ readerr: /* Read error. If feof(fp) is true, fall through to unexpected EOF. */
}
}
uxeof:/* Unexpected AOF end of file. */
uxeof:/* Unexpected AOF end of file. */
redisLog(REDIS_WARNING,"Unexpected end of file reading the append only file");
if(server.aof_load_truncated){
redisLog(REDIS_WARNING,"!!! Warning: short read while loading the AOF file !!!");
redisLog(REDIS_WARNING,
"AOF loaded anyway because aof-load-truncated is enabled");
gotoloaded_ok;
}
redisLog(REDIS_WARNING,"Unexpected end of file reading the append only file. You can: 1) Make a backup of your AOF file, then use ./redis-check-aof --fix <filename>. 2) Alternatively you can set the 'aof-load-truncated' configuration option to yes and restart the server.");