Re-archive the WAL on standby with archive_mode=always? - Mailing list pgsql-hackers

From Japin Li
Subject Re-archive the WAL on standby with archive_mode=always?
Date
Msg-id ME0P300MB0445CFEF72BF6D2030769F6EB65DA@ME0P300MB0445.AUSP300.PROD.OUTLOOK.COM
Whole thread Raw
List pgsql-hackers
Hi, hackers,

I was recently reviewing the KeepFileRestoredFromArchive() function and came
across a section that raised a question for me:

    /*
     * Create .done file forcibly to prevent the restored segment from being
     * archived again later.
     */
    if (XLogArchiveMode != ARCHIVE_MODE_ALWAYS)
        XLogArchiveForceDone(xlogfname);
    else
        XLogArchiveNotify(xlogfname);

My understanding is that the WAL segment in this context has just been
restored from the archive.

However, for archive_mode=always, the code calls XLogArchiveNotify(xlogfname),
which, if I understand correctly, signals the archiver to re-archive this
already-archived WAL segment.

Is there a specific scenario or benefit I'm overlooking?

-- 
Regards,
Japin Li



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Document slot's restart_lsn can go backward
Next
From: Dilip Kumar
Date:
Subject: Re: Logical Replication of sequences