• Joe Hu's avatar
    Fix RDB check regression caused by PR 12022 (#12051) · 644d9455
    Joe Hu authored
    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.
    644d9455
rdb.c 141 KB