postgres.git / summary / log / commit / refs

commit    cf86fddc1c928b02821c66cbe1ddec3ad7da987c
Author:   Noah Misch <noah@leadboat.com>
Date:     Fri Aug 05 15:30:58 2022 +0000
First released in: 10.22, 11.17, 12.12, 13.8, 14.5
Reverted by: e77d9cd4f52e (in 13.21), 47d2d2982729 (in 14.18)

    Add HINT for restartpoint race with KeepFileRestoredFromArchive().
    
    The five commits ending at cc2c7d65fc27e877c9f407587b0b92d46cd6dd16
    closed this race condition for v15+.  For v14 through v10, add a HINT to
    discourage studying the cosmetic problem.
    
    Reviewed by Kyotaro Horiguchi and David Steele.
    
    Discussion: https://postgr.es/m/20220731061747.GA3692882@rfd.leadboat.com


src/backend/access/transam/xlog.c | 5 ++++- src/backend/storage/file/fd.c | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 5f801dd51e8..948e3295d38 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -3381,7 +3381,10 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock) if (fd < 0) ereport(ERROR, (errcode_for_file_access(), - errmsg("could not open file \"%s\": %m", path))); + errmsg("could not open file \"%s\": %m", path), + (AmCheckpointerProcess() ? + errhint("This is known to fail occasionally during archive recovery, where it is harmless.") : + 0))); elog(DEBUG2, "done creating and filling new WAL file"); diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index 1091d455cb4..03ec6b0142f 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -753,7 +753,10 @@ durable_link_or_rename(const char *oldfile, const char *newfile, int elevel) ereport(elevel, (errcode_for_file_access(), errmsg("could not link file \"%s\" to \"%s\": %m", - oldfile, newfile))); + oldfile, newfile), + (AmCheckpointerProcess() ? + errhint("This is known to fail occasionally during archive recovery, where it is harmless.") : + 0))); return -1; } unlink(oldfile); @@ -764,7 +767,10 @@ durable_link_or_rename(const char *oldfile, const char *newfile, int elevel) ereport(elevel, (errcode_for_file_access(), errmsg("could not rename file \"%s\" to \"%s\": %m", - oldfile, newfile))); + oldfile, newfile), + (AmCheckpointerProcess() ? + errhint("This is known to fail occasionally during archive recovery, where it is harmless.") : + 0))); return -1; } #endif [parent: 91130dd316f7]