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

Commitc3652f9

Browse files
committed
Fix new recovery test for use under msys
Commitcaba8f0 wasn't quite right for msys, as demonstrated byseveral buildfarm animals, including jacana and fairywren. We need touse the msys perl in the archive command, but call it in such a way thatWindows will understand the path. Furthermore, inside the copy script weneed to convert a Windows path to an msys path.
1 parentb56b83a commitc3652f9

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

‎src/test/recovery/t/025_stuck_on_old_timeline.pl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
use warnings;
1111
use PostgresNode;
1212
use TestLib;
13+
14+
use File::Basename;
1315
use FindBin;
1416
use Test::Moretests=> 1;
1517

@@ -23,12 +25,17 @@
2325
# get there.
2426
$node_primary->init(allows_streaming=> 1,has_archiving=> 1);
2527
my$perlbin = $^X;
26-
$perlbin =~s{\\}{\\\\}gif ($TestLib::windows_os);
28+
if ($^Oeq'msys')
29+
{
30+
$perlbin = TestLib::perl2host(dirname($^X)) .'\\' . basename($^X);
31+
}
32+
$perlbin =~s!\\!/!gif$TestLib::windows_os;
2733
my$archivedir_primary =$node_primary->archive_dir;
2834
$node_primary->append_conf('postgresql.conf',qq(
29-
archive_command = '$perlbin "$FindBin::RealBin/cp_history_files" "%p" "$archivedir_primary/%f"'
35+
archive_command = '"$perlbin" "$FindBin::RealBin/cp_history_files" "%p" "$archivedir_primary/%f"'
3036
wal_keep_size=128MB
3137
));
38+
local$ENV{PERL_BADLANG}=0;
3239
$node_primary->start;
3340

3441
# Take backup from primary
@@ -74,7 +81,8 @@
7481
# WAL segment, this is enough to guarantee that the history file was
7582
# archived.
7683
my$archive_wait_query =
77-
"SELECT '$walfile_to_be_archived' <= last_archived_wal FROM pg_stat_archiver;";
84+
"SELECT coalesce('$walfile_to_be_archived' <= last_archived_wal, false)" .
85+
"FROM pg_stat_archiver";
7886
$node_standby->poll_query_until('postgres',$archive_wait_query)
7987
ordie"Timed out while waiting for WAL segment to be archived";
8088
my$last_archived_wal_file =$walfile_to_be_archived;

‎src/test/recovery/t/cp_history_files

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,11 @@ use warnings;
77
die"wrong number of arguments"if@ARGV != 2;
88
my ($source,$target) =@ARGV;
99
exitif$source !~/history/;
10+
if ($^Oeq'msys')
11+
{
12+
# make a windows path look like an msys path if necessary
13+
$source =~s!^([A-Za-z]):!'/' . lc($1)!e;
14+
$source =~s!\\!/!g;
15+
}
16+
1017
copy($source,$target)ordie"couldn't copy$source to$target:$!";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp