Use synchronous replication for follower tests

pull/3027/head^2
Jelte Fennema 2019-09-24 14:17:40 +02:00
parent 78ccc323d1
commit 0f90c2497e
1 changed files with 9 additions and 2 deletions

View File

@ -67,6 +67,7 @@ my $pgxsdir = "";
my $postgresBuilddir = "";
my $postgresSrcdir = "";
my $majorversion = "";
my $synchronousReplication = "";
my @extensions = ();
my @userPgOptions = ();
my %fdws = ();
@ -645,10 +646,16 @@ if ($valgrind)
# Signal that servers should be shutdown
$serversAreShutdown = "FALSE";
# enable synchronous replication if needed
if ($followercluster)
{
$synchronousReplication = "-c synchronous_standby_names='FIRST 1 (*)' -c synchronous_commit=remote_apply";
}
# Start servers
if(system(catfile("$bindir", "pg_ctl"),
('start', '-w',
'-o', join(" ", @pgOptions)." -c port=$masterPort",
'-o', join(" ", @pgOptions)." -c port=$masterPort $synchronousReplication",
'-D', catfile($TMP_CHECKDIR, $MASTERDIR, 'data'), '-l', catfile($TMP_CHECKDIR, $MASTERDIR, 'log', 'postmaster.log'))) != 0)
{
system("tail", ("-n20", catfile($TMP_CHECKDIR, $MASTERDIR, "log", "postmaster.log")));
@ -659,7 +666,7 @@ for my $port (@workerPorts)
{
if(system(catfile("$bindir", "pg_ctl"),
('start', '-w',
'-o', join(" ", @pgOptions)." -c port=$port",
'-o', join(" ", @pgOptions)." -c port=$port $synchronousReplication",
'-D', catfile($TMP_CHECKDIR, "worker.$port", "data"),
'-l', catfile($TMP_CHECKDIR, "worker.$port", "log", "postmaster.log"))) != 0)
{