10000 Add HINT for restartpoint race with KeepFileRestoredFromArchive(). · postgres/postgres@cf86fdd · GitHub
[go: up one dir, main page]

Skip to content

Commit cf86fdd

Browse files
committed
Add HINT for restartpoint race with KeepFileRestoredFromArchive().
The five commits ending at cc2c7d6 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
1 parent 91130dd commit cf86fdd

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/backend/access/transam/xlog.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3381,7 +3381,10 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock)
33813381
if (fd < 0)
33823382
ereport(ERROR,
33833383
(errcode_for_file_access(),
3384-
errmsg("could not open file \"%s\": %m", path)));
3384+
errmsg("could not open file \"%s\": %m", path),
3385+
(AmCheckpointerProcess() ?
3386+
errhint("This is known to fail occasionally during archive recovery, where it is harmless.") :
3387+
0)));
33853388

33863389
elog(DEBUG2, "done creating and filling new WAL file");
33873390

src/backend/storage/file/fd.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,10 @@ durable_link_or_rename(const char *oldfile, const char *newfile, int elevel)
753753
ereport(elevel,
754754
(errcode_for_file_access(),
755755
errmsg("could not link file \"%s\" to \"%s\": %m",
756-
oldfile, newfile)));
756+
oldfile, newfile),
757+
(AmCheckpointerProcess() ?
758+
errhint("This is known to fail occasionally during archive recovery, where it is harmless.") :
759+
0)));
757760
return -1;
758761
}
759762
unlink(oldfile);
@@ -764,7 +767,10 @@ durable_link_or_rename(const char *oldfile, const char *newfile, int elevel)
764767
ereport(elevel,
765768
(errcode_for_file_access(),
766769
errmsg("could not rename file \"%s\" to \"%s\": %m",
767-
oldfile, newfile)));
770+
oldfile, newfile),
771+
(AmCheckpointerProcess() ?
772+
errhint("This is known to fail occasionally during archive recovery, where it is harmless.") :
773+
0)));
768774
return -1;
769775
}
770776
#endif

0 commit comments

Comments
 (0)
0