aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2022-04-28 13:08:16 +0900
committerMichael Paquier <michael@paquier.xyz>2022-04-28 13:08:16 +0900
commit55b56865115eccd6449e79d6f06fe49d6ba3b792 (patch)
tree06e87b08b6c6a27e472448c7edd1407b8f7e707d /contrib
parente84f82ab5cff2811745ae8e2ac163a4b8b733394 (diff)
downloadpostgresql-55b56865115eccd6449e79d6f06fe49d6ba3b792.tar.gz
postgresql-55b56865115eccd6449e79d6f06fe49d6ba3b792.zip
Revert recent changes with durable_rename_excl()
This reverts commits 2c902bb and ccfbd92. Per buildfarm members kestrel, rorqual and calliphoridae, the assertions checking that a TLI history file should not exist when created by a WAL receiver have been failing, and switching to durable_rename() over durable_rename_excl() would cause the newest TLI history file to overwrite the existing one. We need to think harder about such cases, so revert the new logic for now. Note that all the failures have been reported in the test 025_stuck_on_old_timeline. Discussion: https://postgr.es/m/511362.1651116498@sss.pgh.pa.us
Diffstat (limited to 'contrib')
-rw-r--r--contrib/basic_archive/basic_archive.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/contrib/basic_archive/basic_archive.c b/contrib/basic_archive/basic_archive.c
index ed33854c578..e7efbfb9c34 100644
--- a/contrib/basic_archive/basic_archive.c
+++ b/contrib/basic_archive/basic_archive.c
@@ -281,10 +281,9 @@ basic_archive_file_internal(const char *file, const char *path)
/*
* Sync the temporary file to disk and move it to its final destination.
- * Note that this will overwrite any existing file, but this is only
- * possible if someone else created the file since the stat() above.
+ * This will fail if destination already exists.
*/
- (void) durable_rename(temp, destination, ERROR);
+ (void) durable_rename_excl(temp, destination, ERROR);
ereport(DEBUG1,
(errmsg("archived \"%s\" via basic_archive", file)));