Revert "Add HINT for restartpoint race with KeepFileRestoredFromArchive()."
authorMichael Paquier <[email protected]>
Sun, 6 Apr 2025 06:14:52 +0000 (15:14 +0900)
committerMichael Paquier <[email protected]>
Sun, 6 Apr 2025 06:14:52 +0000 (15:14 +0900)
This reverts commit 8ad6c5dbbe5a, which was a commit specific to v14 and
older branches as the race condition between restartpoints and
KeepFileRestoredFromArchive() still existed.

1f95181b44c8 has worsened the situation on these two branches, causing
spurious failures in archive recovery (neither streaming nor archive
recovery) with concurrent restartpoints.  The same logic as v15 and
newer versions will be applied in some follow-up commits to close this
problem, making this HINT not necessary anymore.

Reported-by: Arun Thirupathi
Discussion: https://postgr.es/m/20250306193013[email protected]
Backpatch-through: 13

src/backend/access/transam/xlog.c
src/backend/storage/file/fd.c

index d862954709088b93e6f921a14176f562c4d92a1d..793451bdf70c89024e0468c6483aeb38fe5c0dc4 100644 (file)
@@ -3468,10 +3468,7 @@ XLogFileInit(XLogSegNo logsegno, bool *added)
    if (fd < 0)
        ereport(ERROR,
                (errcode_for_file_access(),
-                errmsg("could not open file \"%s\": %m", path),
-                (AmCheckpointerProcess() ?
-                 errhint("This is known to fail occasionally during archive recovery, where it is harmless.") :
-                 0)));
+                errmsg("could not open file \"%s\": %m", path)));
 
    elog(DEBUG2, "done creating and filling new WAL file");
 
index 09c4a93e40b0a2135613be132adbdd510b845c13..484a07302a406000a74b30f7124dcb69ecfc3f1c 100644 (file)
@@ -834,10 +834,7 @@ durable_rename_excl(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),
-                (AmCheckpointerProcess() ?
-                 errhint("This is known to fail occasionally during archive recovery, where it is harmless.") :
-                 0)));
+                       oldfile, newfile)));
        return -1;
    }
    unlink(oldfile);
@@ -847,10 +844,7 @@ durable_rename_excl(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),
-                (AmCheckpointerProcess() ?
-                 errhint("This is known to fail occasionally during archive recovery, where it is harmless.") :
-                 0)));
+                       oldfile, newfile)));
        return -1;
    }
 #endif