• Heikki Linnakangas's avatar
    Fix archive_cleanup_command. · 644a0a63
    Heikki Linnakangas authored
    When I moved ExecuteRecoveryCommand() from xlog.c to xlogarchive.c, I didn't
    realize that it's called from the checkpoint process, not the startup
    process. I tried to use InRedo variable to decide whether or not to attempt
    cleaning up the archive (must not do so before we have read the initial
    checkpoint record), but that variable is only valid within the startup
    process.
    
    Instead, let ExecuteRecoveryCommand() always clean up the archive, and add
    an explicit argument to RestoreArchivedFile() to say whether that's allowed
    or not. The caller knows better.
    
    Reported by Erik Rijkers, diagnosis by Fujii Masao. Only 9.3devel is
    affected.
    644a0a63
xlog.c 294 KB