summaryrefslogtreecommitdiff
path: root/src/redis-check-aof.c
diff options
context:
space:
mode:
authorJoe Hu <jowhuw@amazon.com>2023-04-17 14:05:36 -0400
committerGitHub <noreply@github.com>2023-04-17 21:05:36 +0300
commit644d94558a739656f81343f3b8a12205d53eeeb7 (patch)
tree50e88486643de035ed887f6dcc27fb0e5498245c /src/redis-check-aof.c
parente7f18432b8e9e1d1998d3a898006497e6c5e5a32 (diff)
downloadredis-644d94558a739656f81343f3b8a12205d53eeeb7.tar.gz
Fix RDB check regression caused by PR 12022 (#12051)
The nightly tests showed that the recent PR #12022 caused random failures in aof.tcl on checking RDB preamble inside an AOF file. Root cause: When checking RDB preamble in an AOF file, what's passed into redis_check_rdb is aof_filename, not aof_filepath. The newly introduced isFifo function does not check return status of the stat call and hence uses the uninitailized stat_p object. Fix: 1. Fix isFifo by checking stat call's return code. 2. Pass aof_filepath instead of aof_filename to redis_check_rdb. 3. move the FIFO check to rdb.c since the limitation is the re-opening of the file, and not anything specific about redis-check-rdb.
Diffstat (limited to 'src/redis-check-aof.c')
-rw-r--r--src/redis-check-aof.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/redis-check-aof.c b/src/redis-check-aof.c
index 54d70ae50..616177a8b 100644
--- a/src/redis-check-aof.c
+++ b/src/redis-check-aof.c
@@ -242,7 +242,7 @@ int checkSingleAof(char *aof_filename, char *aof_filepath, int last_file, int fi
}
if (preamble) {
- char *argv[2] = {NULL, aof_filename};
+ char *argv[2] = {NULL, aof_filepath};
if (redis_check_rdb_main(2, argv, fp) == C_ERR) {
printf("RDB preamble of AOF file is not sane, aborting.\n");
exit(1);