summaryrefslogtreecommitdiff
path: root/src/aof.c
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2022-08-04 15:47:37 +0800
committerGitHub <noreply@github.com>2022-08-04 10:47:37 +0300
commit4505eb18213c8da31c6dd39ba7cd36d3d01141a5 (patch)
tree4cbf4047cac3d13ff1b17145fb358a7bc6627702 /src/aof.c
parent6686c6d774fcf71fffbaeff798c997ab3eff80de (diff)
downloadredis-4505eb18213c8da31c6dd39ba7cd36d3d01141a5.tar.gz
errno cleanup around rdbLoad (#11042)
This is an addition to #11039, which cleans up rdbLoad* related errno. Remove the errno print from the outer message (may be invalid since errno may have been overwritten). Our aim should be the code that detects the error and knows which system call triggered it, is the one to print errno, and not the code way up above (in some cases a result of a logical error and not a system one). Remove the code to update errno in rdbLoadRioWithLoadingCtx, signature check and the rdb version check, in these cases, we do print the error message. The caller dose not have the specific logic for handling EINVAL. Small fix around rdb-preamble AOF: A truncated RDB is considered a failure, not handled the same as a truncated AOF file.
Diffstat (limited to 'src/aof.c')
-rw-r--r--src/aof.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/aof.c b/src/aof.c
index 482ec786d..1f0b824f1 100644
--- a/src/aof.c
+++ b/src/aof.c
@@ -1432,7 +1432,8 @@ int loadSingleAppendOnlyFile(char *filename) {
else
serverLog(LL_WARNING, "Error reading the RDB base file %s, AOF loading aborted", filename);
- goto readerr;
+ ret = AOF_FAILED;
+ goto cleanup;
} else {
loadingAbsProgress(ftello(fp));
last_progress_report_size = ftello(fp);