Skip to content

Commit 69b7a35

Browse files
committed
Clean up pg_rewind regression test script.
Since commit 01f6bb4, TestLib.pm has exported path to tmp_check directory, so let's use that also for the pg_rewind test clusters etc. Also, in master, the $tempdir_short variable has not been used since commit 13d856e, which moved the initdb-running code to TestLib.pm. Backpatch to 9.5.
1 parent e2b49db commit 69b7a35

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

src/bin/pg_rewind/RewindTest.pm

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,13 @@ our @EXPORT = qw(
6262
clean_rewind_test
6363
);
6464

65-
# A temporary directory created with 'tempdir' is deleted automatically at
66-
# the end of the tests. You can change it to a constant if you need to keep it
67-
# for debugging purposes,
68-
my $testroot = tempdir;
69-
70-
our $test_master_datadir = "$testroot/data_master";
71-
our $test_standby_datadir = "$testroot/data_standby";
72-
73-
mkdir $testroot;
65+
our $test_master_datadir = "$tmp_check/data_master";
66+
our $test_standby_datadir = "$tmp_check/data_standby";
7467

7568
# Define non-conflicting ports for both nodes.
7669
my $port_master = $ENV{PGPORT};
7770
my $port_standby = $port_master + 1;
7871

79-
my $tempdir_short;
80-
8172
my $connstr_master = "port=$port_master";
8273
my $connstr_standby = "port=$port_standby";
8374

@@ -171,8 +162,6 @@ sub append_to_file
171162

172163
sub setup_cluster
173164
{
174-
$tempdir_short = tempdir_short;
175-
176165
# Initialize master, data checksums are mandatory
177166
remove_tree($test_master_datadir);
178167
standard_initdb($test_master_datadir);
@@ -267,9 +256,8 @@ sub run_pg_rewind
267256

268257
# Keep a temporary postgresql.conf for master node or it would be
269258
# overwritten during the rewind.
270-
copy(
271-
"$test_master_datadir/postgresql.conf",
272-
"$testroot/master-postgresql.conf.tmp");
259+
copy("$test_master_datadir/postgresql.conf",
260+
"$tmp_check/master-postgresql.conf.tmp");
273261

274262
# Now run pg_rewind
275263
if ($test_mode eq "local")
@@ -302,9 +290,8 @@ sub run_pg_rewind
302290
}
303291

304292
# Now move back postgresql.conf with old settings
305-
move(
306-
"$testroot/master-postgresql.conf.tmp",
307-
"$test_master_datadir/postgresql.conf");
293+
move("$tmp_check/master-postgresql.conf.tmp",
294+
"$test_master_datadir/postgresql.conf");
308295

309296
# Plug-in rewound node to the now-promoted standby node
310297
append_to_file(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy