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

Skip to content

Commit ad8ebcf

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 d2a7462 commit ad8ebcf

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
@@ -3436,7 +3436,10 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock)
34363436
if (fd < 0)
34373437
ereport(ERROR,
34383438
(errcode_for_file_access(),
3439-
errmsg("could not open file \"%s\": %m", path)));
3439+
errmsg("could not open file \"%s\": %m", path),
3440+
(AmCheckpointerProcess() ?
3441+
errhint("This is known to fail occasionally during archive recovery, where it is harmless.") :
3442+
0)));
34403443

34413444
elog(DEBUG2, "done creating and filling new WAL file");
34423445

src/backend/storage/file/fd.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,10 @@ durable_rename_excl(const char *oldfile, const char *newfile, int elevel)
800800
ereport(elevel,
801801
(errcode_for_file_access(),
802802
errmsg("could not link file \"%s\" to \"%s\": %m",
803-
oldfile, newfile)));
803+
oldfile, newfile),
804+
(AmCheckpointerProcess() ?
805+
errhint("This is known to fail occasionally during archive recovery, where it is harmless.") :
806+
0)));
804807
return -1;
805808
}
806809
unlink(oldfile);
@@ -810,7 +813,10 @@ durable_rename_excl(const char *oldfile, const char *newfile, int elevel)
810813
ereport(elevel,
811814
(errcode_for_file_access(),
812815
errmsg("could not rename file \"%s\" to \"%s\": %m",
813-
oldfile, newfile)));
816+
oldfile, newfile),
817+
(AmCheckpointerProcess() ?
818+
errhint("This is known to fail occasionally during archive recovery, where it is harmless.") :
819+
0)));
814820
return -1;
815821
}
816822
#endif

0 commit comments

Comments
 (0)