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


Reply via email to