Skip to content

Commit e9f15bc

Browse files
committed
Fix tmpdir issues with commit e213de8
Commit e213de8 fixed a problem with path lengths to a tempdir on Windows, but caused problems on at least some Unix systems where the system tempdir is on a different file system. To work around this, only used the system temdir for the destination of pg_replslot on Windows, and otherwise restore the old behaviour. Backpatch to relase 14 like the previous patch. Problem exposed by a myriad of buildfarm animals.
1 parent e213de8 commit e9f15bc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/bin/pg_basebackup/t/010_pg_basebackup.pl

+6-2
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,13 @@
342342
# Create a temporary directory in the system location.
343343
my $sys_tempdir = PostgreSQL::Test::Utils::tempdir_short;
344344

345-
rename("$pgdata/pg_replslot", "$sys_tempdir/pg_replslot")
345+
# On Windows use the short location to avoid path length issues.
346+
# Elsewhere use $tempdir to avoid file system boundary issues with moving.
347+
my $tmploc = $windows_os ? $sys_tempdir : $tempdir;
348+
349+
rename("$pgdata/pg_replslot", "$tmploc/pg_replslot")
346350
or BAIL_OUT "could not move $pgdata/pg_replslot";
347-
dir_symlink("$sys_tempdir/pg_replslot", "$pgdata/pg_replslot")
351+
dir_symlink("$tmploc/pg_replslot", "$pgdata/pg_replslot")
348352
or BAIL_OUT "could not symlink to $pgdata/pg_replslot";
349353

350354
$node->start;

0 commit comments

Comments
 (0)