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

Wait for first fault before injecting second

The dtm_recovery_on_standby test starts two sessions.  Both the
sessions are expected to hit different faults.  The test used to start
first session, inject faults for the second session and wait for all
the faults to be hit.  This led to spurious failures in CI because the
first session would incorrectly hit faults intended for second
session.  The commit fixes this, such that the test waits for the
first session to hit the right fault before injecting faults for the
second session.
上级 cc09cb57
......@@ -23,6 +23,12 @@ select gp_inject_fault('dtm_broadcast_commit_prepared', 'suspend', dbid) from gp
1&: create table committed_by_standby(a int, b int); <waiting ...>
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)
-- Scenario2: standby broadcasts abort-prepared for a transaction that
-- doesn't have distributed commit recorded in XLOG. Inject faults
-- such that the QD backend errors out after prepare broadcast and
......@@ -41,12 +47,6 @@ 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
-------------------------------
......
......@@ -15,6 +15,9 @@ from gp_segment_configuration where content = -1 and role = 'p';
1&: create table committed_by_standby(a int, b int);
select gp_wait_until_triggered_fault('dtm_broadcast_commit_prepared', 1, dbid)
from gp_segment_configuration where content = -1 and role = 'p';
-- Scenario2: standby broadcasts abort-prepared for a transaction that
-- doesn't have distributed commit recorded in XLOG. Inject faults
-- such that the QD backend errors out after prepare broadcast and
......@@ -27,9 +30,6 @@ 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';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册