aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/file/fd.c
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2022-08-05 08:30:58 -0700
committerNoah Misch <noah@leadboat.com>2022-08-05 08:31:02 -0700
commit41f613fc257c4d1df97f5f244461d1acb2b65227 (patch)
tree95a99a8f3b3bacea457f07328ad9f86ceedb92b7 /src/backend/storage/file/fd.c
parent4ad4c1f419477a3a450ecaa6b3a367c227a7df66 (diff)
downloadpostgresql-41f613fc257c4d1df97f5f244461d1acb2b65227.tar.gz
postgresql-41f613fc257c4d1df97f5f244461d1acb2b65227.zip
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
Diffstat (limited to 'src/backend/storage/file/fd.c')
-rw-r--r--src/backend/storage/file/fd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index decf5ff9cbe..5614b8b9161 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -748,7 +748,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);
@@ -759,7 +762,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