mirror of https://github.com/citusdata/citus.git
Use synchronous replication for follower tests
parent
78ccc323d1
commit
0f90c2497e
|
@ -67,6 +67,7 @@ my $pgxsdir = "";
|
||||||
my $postgresBuilddir = "";
|
my $postgresBuilddir = "";
|
||||||
my $postgresSrcdir = "";
|
my $postgresSrcdir = "";
|
||||||
my $majorversion = "";
|
my $majorversion = "";
|
||||||
|
my $synchronousReplication = "";
|
||||||
my @extensions = ();
|
my @extensions = ();
|
||||||
my @userPgOptions = ();
|
my @userPgOptions = ();
|
||||||
my %fdws = ();
|
my %fdws = ();
|
||||||
|
@ -645,10 +646,16 @@ if ($valgrind)
|
||||||
# Signal that servers should be shutdown
|
# Signal that servers should be shutdown
|
||||||
$serversAreShutdown = "FALSE";
|
$serversAreShutdown = "FALSE";
|
||||||
|
|
||||||
|
# enable synchronous replication if needed
|
||||||
|
if ($followercluster)
|
||||||
|
{
|
||||||
|
$synchronousReplication = "-c synchronous_standby_names='FIRST 1 (*)' -c synchronous_commit=remote_apply";
|
||||||
|
}
|
||||||
|
|
||||||
# Start servers
|
# Start servers
|
||||||
if(system(catfile("$bindir", "pg_ctl"),
|
if(system(catfile("$bindir", "pg_ctl"),
|
||||||
('start', '-w',
|
('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)
|
'-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")));
|
system("tail", ("-n20", catfile($TMP_CHECKDIR, $MASTERDIR, "log", "postmaster.log")));
|
||||||
|
@ -659,7 +666,7 @@ for my $port (@workerPorts)
|
||||||
{
|
{
|
||||||
if(system(catfile("$bindir", "pg_ctl"),
|
if(system(catfile("$bindir", "pg_ctl"),
|
||||||
('start', '-w',
|
('start', '-w',
|
||||||
'-o', join(" ", @pgOptions)." -c port=$port",
|
'-o', join(" ", @pgOptions)." -c port=$port $synchronousReplication",
|
||||||
'-D', catfile($TMP_CHECKDIR, "worker.$port", "data"),
|
'-D', catfile($TMP_CHECKDIR, "worker.$port", "data"),
|
||||||
'-l', catfile($TMP_CHECKDIR, "worker.$port", "log", "postmaster.log"))) != 0)
|
'-l', catfile($TMP_CHECKDIR, "worker.$port", "log", "postmaster.log"))) != 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue