Skip to content

Commit 1a02684

Browse files
committed
fixes
1 parent a290fbd commit 1a02684

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/test/recovery/t/twophase_recovery_bug.pl

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
use warnings;
33
use PostgresNode;
44
use TestLib;
5-
use Test::More tests => 1;
5+
use Test::More tests => 2;
66

77
# Setup master node
8-
my $node_master = get_new_node("Candie");
8+
my $node_master = get_new_node("master");
99
$node_master->init(allows_streaming => 1);
1010
$node_master->append_conf('postgresql.conf', qq(
1111
max_prepared_transactions = 10
@@ -14,8 +14,8 @@
1414
$node_master->backup('master_backup');
1515
$node_master->psql('postgres', "create table t(id int)");
1616

17-
# Setup master node
18-
my $node_slave = get_new_node('Django');
17+
# Setup slave node
18+
my $node_slave = get_new_node('slave');
1919
$node_slave->init_from_backup($node_master, 'master_backup', has_streaming => 1);
2020
$node_slave->start;
2121

@@ -35,12 +35,11 @@
3535
select * from t2 for share;
3636
prepare transaction 'x';
3737
");
38-
sleep 2;
38+
sleep 2; # wait for changes to arrive on slave
3939
$node_slave->teardown_node;
4040
$node_master->psql('postgres',"commit prepared 'x'");
4141
$node_slave->start;
4242
$node_slave->psql('postgres',"select count(*) from pg_prepared_xacts", stdout => \$psql_out);
43-
4443
is($psql_out, '0', "Commit prepared on master while slave is down.");
45-
46-
44+
$node_slave->psql('postgres',"select sum(id) from t2", stdout => \$psql_out);
45+
is($psql_out, '2', "Check that tx changes are visible.");

0 commit comments

Comments
 (0)