aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_rewind/RewindTest.pm
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2016-02-26 13:24:22 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2016-02-26 13:24:22 -0300
commit89ac7004dadf4116d9b180bb5ff64b64bfce94b1 (patch)
tree3a9c8e9eea1b78e786a6811b5dfd60ab13715438 /src/bin/pg_rewind/RewindTest.pm
parent7bea19d0a9d3e6975418ffe685fb510bd31ab434 (diff)
downloadpostgresql-89ac7004dadf4116d9b180bb5ff64b64bfce94b1.tar.gz
postgresql-89ac7004dadf4116d9b180bb5ff64b64bfce94b1.zip
Move some code from RewindTest into PostgresNode
Some code in the RewindTest test suite is more generally useful than just for that suite, so put it where other test suites can reach it. Some postgresql.conf parameters change their default values when a cluster is initialized with 'allows_streaming' than the previous behavior; most notably, autovacuum is no longer turned off. (Also, we no longer call pg_ctl promote with -w, but that flag doesn't actually do anything in promote so there's no behavior change.) Author: Michael Paquier
Diffstat (limited to 'src/bin/pg_rewind/RewindTest.pm')
-rw-r--r--src/bin/pg_rewind/RewindTest.pm19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/bin/pg_rewind/RewindTest.pm b/src/bin/pg_rewind/RewindTest.pm
index 68834cd6a44..bda0516cb3f 100644
--- a/src/bin/pg_rewind/RewindTest.pm
+++ b/src/bin/pg_rewind/RewindTest.pm
@@ -114,24 +114,9 @@ sub check_query
sub setup_cluster
{
-
# Initialize master, data checksums are mandatory
$node_master = get_new_node('master');
- $node_master->init;
-
- # Custom parameters for master's postgresql.conf
- $node_master->append_conf(
- "postgresql.conf", qq(
-wal_level = hot_standby
-max_wal_senders = 2
-wal_keep_segments = 20
-max_wal_size = 200MB
-shared_buffers = 1MB
-wal_log_hints = on
-hot_standby = on
-autovacuum = off
-max_connections = 10
-));
+ $node_master->init(allows_streaming => 1);
}
sub start_master
@@ -177,7 +162,7 @@ sub promote_standby
# Now promote slave and insert some new data on master, this will put
# the master out-of-sync with the standby. Wait until the standby is
# out of recovery mode, and is ready to accept read-write connections.
- system_or_bail('pg_ctl', '-w', '-D', $node_standby->data_dir, 'promote');
+ $node_standby->promote;
$node_standby->poll_query_until('postgres',
"SELECT NOT pg_is_in_recovery()")
or die "Timed out while waiting for promotion of standby";