Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2ffcb7d

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/[email protected]
1 parent 1382136 commit 2ffcb7d

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
@@ -3354,7 +3354,10 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock)
33543354
if (fd < 0)
33553355
ereport(ERROR,
33563356
(errcode_for_file_access(),
3357-
errmsg("could not open file \"%s\": %m", path)));
3357+
errmsg("could not open file \"%s\": %m", path),
3358+
(AmCheckpointerProcess() ?
3359+
errhint("This is known to fail occasionally during archive recovery, where it is harmless.") :
3360+
0)));
33583361

33593362
elog(DEBUG2, "done creating and filling new WAL file");
33603363

src/backend/storage/file/fd.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,10 @@ durable_link_or_rename(const char *oldfile, const char *newfile, int elevel)
744744
ereport(elevel,
745745
(errcode_for_file_access(),
746746
errmsg("could not link file \"%s\" to \"%s\": %m",
747-
oldfile, newfile)));
747+
oldfile, newfile),
748+
(AmCheckpointerProcess() ?
749+
errhint("This is known to fail occasionally during archive recovery, where it is harmless.") :
750+
0)));
748751
return -1;
749752
}
750753
unlink(oldfile);
@@ -755,7 +758,10 @@ durable_link_or_rename(const char *oldfile, const char *newfile, int elevel)
755758
ereport(elevel,
756759
(errcode_for_file_access(),
757760
errmsg("could not rename file \"%s\" to \"%s\": %m",
758-
oldfile, newfile)));
761+
oldfile, newfile),
762+
(AmCheckpointerProcess() ?
763+
errhint("This is known to fail occasionally during archive recovery, where it is harmless.") :
764+
0)));
759765
return -1;
760766
}
761767
#endif

0 commit comments

Comments
 (0)