Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit468b236

Browse files
committed
Symlink pg_replslot robustly on Windows in pg_basebackup test
This reverts commite9f15bc. Instead of a hacky solution that didn'twork on Windows, we avoid trying to move the directory possibly acrossdrives, and instead remove it and recreate it in the new location.Discussion:https://postgr.es/m/20240707070243.sb77kp4ubowauctz@awork3.anarazel.deBackpatch to release 14 like the previous patch.
1 parent3347042 commit468b236

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,13 @@
353353
# Create a temporary directory in the system location.
354354
my$sys_tempdir = PostgreSQL::Test::Utils::tempdir_short;
355355

356-
#On Windows use the short location to avoid path length issues.
357-
#Elsewhere use $tempdirto avoidfile system boundary issues with moving.
358-
my$tmploc =$windows_os ?$sys_tempdir :$tempdir;
359-
360-
rename("$pgdata/pg_replslot","$tmploc/pg_replslot")
361-
or BAIL_OUT"could not move$pgdata/pg_replslot";
362-
dir_symlink("$tmploc/pg_replslot","$pgdata/pg_replslot")
356+
#pg_replslot should be empty. We remove it and recreate it in $sys_tempdir
357+
#before symlinking, in orderto avoidpossibly trying to move things across
358+
# drives.
359+
rmdir("$pgdata/pg_replslot")
360+
or BAIL_OUT"could not remove$pgdata/pg_replslot";
361+
mkdir("$sys_tempdir/pg_replslot");# if this fails the symlink will fail
362+
dir_symlink("$sys_tempdir/pg_replslot","$pgdata/pg_replslot")
363363
or BAIL_OUT"could not symlink to$pgdata/pg_replslot";
364364

365365
$node->start;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp