提交 c5eb8f25 编写于 作者: A Asim R P

Make dtm_recovery_on_standby test more deterministic

The test should wait for the transactions to be in the right state
before promoting standby.  This commit adds a wait step to ensure just
that.  One of the ICW jobs in CI failed because the test promoted the
standby before the transactions were preprared on master.  This should
no longer happen now.
上级 72fac815
......@@ -44,6 +44,18 @@ select gp_inject_fault('transaction_abort_failure', 'suspend', dbid) from gp_seg
2&: create table aborted_by_standby(a int, b int); <waiting ...>
-- Wait for the two transactions to be suspended on master
select gp_wait_until_triggered_fault('dtm_broadcast_commit_prepared', 1, dbid) from gp_segment_configuration where content = -1 and role = 'p';
gp_wait_until_triggered_fault
-------------------------------
t
(1 row)
select gp_wait_until_triggered_fault('transaction_abort_failure', 1, dbid) from gp_segment_configuration where content = -1 and role = 'p';
gp_wait_until_triggered_fault
-------------------------------
t
(1 row)
-- Promote standby
select pg_ctl(datadir, 'promote') from gp_segment_configuration where content = -1 and role = 'm';
pg_ctl
......
......@@ -29,6 +29,12 @@ from gp_segment_configuration where content = -1 and role = 'p';
2&: create table aborted_by_standby(a int, b int);
-- Wait for the two transactions to be suspended on master
select gp_wait_until_triggered_fault('dtm_broadcast_commit_prepared', 1, dbid)
from gp_segment_configuration where content = -1 and role = 'p';
select gp_wait_until_triggered_fault('transaction_abort_failure', 1, dbid)
from gp_segment_configuration where content = -1 and role = 'p';
-- Promote standby
select pg_ctl(datadir, 'promote') from gp_segment_configuration
where content = -1 and role = 'm';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册