]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Add HINT for restartpoint race with KeepFileRestoredFromArchive().
authorNoah Misch <noah@leadboat.com>
Fri, 5 Aug 2022 15:30:58 +0000 (08:30 -0700)
committerNoah Misch <noah@leadboat.com>
Fri, 5 Aug 2022 15:31:02 +0000 (08:31 -0700)
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
src/backend/storage/file/fd.c

index d9a1c1da55a21dd768b1857567478e3bbcb2f75f..8e483e226a9cfed5fdabde147d974b503c3af9c9 100644 (file)
@@ -3354,7 +3354,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");
 
index ae3078bcc514e80ad531d45d32d29710e6716529..f127c4fc68cd0b4acd08ca554b37862846ffe64c 100644 (file)
@@ -744,7 +744,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);
@@ -755,7 +758,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