提交 3c01cbaf 编写于 作者: P Paul Guo

Fix flaky test recoverseg_from_file (#10259)

After gprecoverseg, need to wait until the cluster is synchronized before
running subsequent tests.
Reviewed-by: NHubert Zhang <hzhang@pivotal.io>
Reviewed-by: NReviewed-by: Ashwin Agrawal <aagrawal@pivotal.io>

Cherry-picked from d490798b
上级 dbb6ea77
......@@ -115,12 +115,20 @@ SET
-- end_ignore
(exited with code 0)
-- loop while segments come in sync
do $$ begin /* in func */ for i in 1..120 loop /* in func */ if (select count(*) = 0 from gp_segment_configuration where content != -1 and mode != 's') then /* in func */ return; /* in func */ end if; /* in func */ perform gp_request_fts_probe_scan(); /* in func */ end loop; /* in func */ end; /* in func */ $$;
DO
-- rebalance the cluster
!\retcode gprecoverseg -ar;
-- start_ignore
-- end_ignore
(exited with code 0)
-- loop while segments come in sync
do $$ begin /* in func */ for i in 1..120 loop /* in func */ if (select count(*) = 0 from gp_segment_configuration where content != -1 and mode != 's') then /* in func */ return; /* in func */ end if; /* in func */ perform gp_request_fts_probe_scan(); /* in func */ end loop; /* in func */ end; /* in func */ $$;
DO
-- recheck gp_segment_configuration after rebalance
SELECT dbid, role, preferred_role, content, mode, status FROM gp_segment_configuration order by dbid;
dbid | role | preferred_role | content | mode | status
......
......@@ -76,9 +76,33 @@ set allow_system_table_mods to false;
-- at here
!\retcode gprecoverseg -a;
-- loop while segments come in sync
do $$
begin /* in func */
for i in 1..120 loop /* in func */
if (select count(*) = 0 from gp_segment_configuration where content != -1 and mode != 's') then /* in func */
return; /* in func */
end if; /* in func */
perform gp_request_fts_probe_scan(); /* in func */
end loop; /* in func */
end; /* in func */
$$;
-- rebalance the cluster
!\retcode gprecoverseg -ar;
-- loop while segments come in sync
do $$
begin /* in func */
for i in 1..120 loop /* in func */
if (select count(*) = 0 from gp_segment_configuration where content != -1 and mode != 's') then /* in func */
return; /* in func */
end if; /* in func */
perform gp_request_fts_probe_scan(); /* in func */
end loop; /* in func */
end; /* in func */
$$;
-- recheck gp_segment_configuration after rebalance
SELECT dbid, role, preferred_role, content, mode, status FROM gp_segment_configuration order by dbid;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册