提交 b00916e6 编写于 作者: P Pengzhou Tang 提交者: Tang Pengzhou

Fix flaky uao_crash_compaction_row test

This test creates an AO table and inserts data on all segments, then
it deletes some data on seg0 and seg1 and do a vacuum on the AO
table. When doing vacuum, it suspends the QE in seg0 at starting
doing the post vacuum cleanup, then crash the seg0 and finally do
the post crash validation checks using gp_toolkit.__gp_aoseg(), this
function will check all aoseg info on all segments.

The VACUUM process on seg1 is in an uncertain state, it might have
finished the post cleanup which is expected or hasn't started yet,
so the aoseg info in seg1 is uncertain too.

To resolve this, this commit added a new injector on the point all
post vacuum cleanup are committed and validate the aoseg info after
the vacuum process on seg1 reached this point.
上级 3f44f202
......@@ -1825,6 +1825,7 @@ vacuum_rel(Oid relid, RangeVar *relation, int options, VacuumParams *params,
return false;
}
#ifdef FAULT_INJECTOR
if (ao_vacuum_phase == VACOPT_AO_POST_CLEANUP_PHASE)
{
FaultInjector_InjectFaultIfSet(
......@@ -1839,6 +1840,7 @@ vacuum_rel(Oid relid, RangeVar *relation, int options, VacuumParams *params,
"", // databaseName
RelationGetRelationName(onerel)); // tableName
}
#endif
/*
* Silently ignore tables that are temp tables of other backends ---
......@@ -2022,6 +2024,17 @@ vacuum_rel(Oid relid, RangeVar *relation, int options, VacuumParams *params,
PopActiveSnapshot();
CommitTransactionCommand();
#ifdef FAULT_INJECTOR
if (ao_vacuum_phase == VACOPT_AO_POST_CLEANUP_PHASE)
{
FaultInjector_InjectFaultIfSet(
"vacuum_post_cleanup_committed",
DDLNotSpecified,
"", // databaseName
""); // tableName
}
#endif
if (is_appendoptimized && ao_vacuum_phase == 0)
{
/* orchestrate the AO vacuum phases */
......
......@@ -68,12 +68,29 @@ UPDATE 10
-----------------
Success:
(1 row)
3:SELECT gp_inject_fault('vacuum_post_cleanup_committed', 'suspend', 3);
gp_inject_fault
-----------------
Success:
(1 row)
1&:VACUUM crash_before_cleanup_phase; <waiting ...>
3:SELECT gp_wait_until_triggered_fault('compaction_before_cleanup_phase', 1, 2);
gp_wait_until_triggered_fault
-------------------------------
Success:
(1 row)
-- wait seg1 to finish the post-cleanup, this makes the aoseg info of seg1 stable.
3:SELECT gp_wait_until_triggered_fault('vacuum_post_cleanup_committed', 1, 3);
gp_wait_until_triggered_fault
-------------------------------
Success:
(1 row)
-- reset the injection so following commands are not affected.
3:SELECT gp_inject_fault('vacuum_post_cleanup_committed', 'reset', 3);
gp_inject_fault
-----------------
Success:
(1 row)
3:SELECT gp_inject_fault('compaction_before_segmentfile_drop', 'suspend', '', '', 'crash_before_segmentfile_drop', 1, -1, 0, 2);
gp_inject_fault
......
......@@ -33,8 +33,13 @@
-- suspend at intended points.
3:SELECT gp_inject_fault('compaction_before_cleanup_phase', 'suspend', '', '', 'crash_before_cleanup_phase', 1, -1, 0, 2);
3:SELECT gp_inject_fault('vacuum_post_cleanup_committed', 'suspend', 3);
1&:VACUUM crash_before_cleanup_phase;
3:SELECT gp_wait_until_triggered_fault('compaction_before_cleanup_phase', 1, 2);
-- wait seg1 to finish the post-cleanup, this makes the aoseg info of seg1 stable.
3:SELECT gp_wait_until_triggered_fault('vacuum_post_cleanup_committed', 1, 3);
-- reset the injection so following commands are not affected.
3:SELECT gp_inject_fault('vacuum_post_cleanup_committed', 'reset', 3);
3:SELECT gp_inject_fault('compaction_before_segmentfile_drop', 'suspend', '', '', 'crash_before_segmentfile_drop', 1, -1, 0, 2);
2&:VACUUM crash_before_segmentfile_drop;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册