提交 0507aed0 编写于 作者: H Hubert Zhang

Fix flaky test in recoverseg_from_file

1. after stop primary with content=1, we should check promotion
status with 1U:
2. after manually update dbid, we should trigger a fts probe and
wait for the mirror promotion as well.
上级 73e2c13f
......@@ -43,21 +43,38 @@ select gp_request_fts_probe_scan();
t
(1 row)
-- wait for content 0 (earlier mirror, now primary) to finish the promotion
0U: select 1;
-- wait for content 1 (earlier mirror, now primary) to finish the promotion
1U: select 1;
?column?
----------
1
(1 row)
-- Quit this utility mode session, as need to start fresh one below
0Uq: ... <quitting>
1Uq: ... <quitting>
-- make the dbid in gp_segment_configuration not continuous
-- dbid=2 corresponds to content id =0
set allow_system_table_mods to true;
SET
update gp_segment_configuration set dbid=9 where dbid=2;
UPDATE 1
-- trigger failover
select gp_request_fts_probe_scan();
gp_request_fts_probe_scan
---------------------------
t
(1 row)
-- wait for content 0 (earlier mirror, now primary) to finish the promotion
0U: select 1;
?column?
----------
1
(1 row)
-- Quit this utility mode session, as need to start fresh one below
0Uq: ... <quitting>
-- generate recover config file
select generate_recover_config_file( (select datadir from gp_segment_configuration c where c.role='m' and c.content=1), (select port from gp_segment_configuration c where c.role='m' and c.content=1)::text);
generate_recover_config_file
......@@ -65,7 +82,7 @@ select generate_recover_config_file( (select datadir from gp_segment_configurati
(1 row)
-- recover from config file
-- recover from config file, only seg with content=1 will be recovered
!\retcode gprecoverseg -a -i /tmp/recover_config_file;
-- start_ignore
-- end_ignore
......
......@@ -34,21 +34,30 @@ where c.role='p' and c.content=1), 'stop');
-- trigger failover
select gp_request_fts_probe_scan();
-- wait for content 0 (earlier mirror, now primary) to finish the promotion
0U: select 1;
-- wait for content 1 (earlier mirror, now primary) to finish the promotion
1U: select 1;
-- Quit this utility mode session, as need to start fresh one below
0Uq:
1Uq:
-- make the dbid in gp_segment_configuration not continuous
-- dbid=2 corresponds to content id =0
set allow_system_table_mods to true;
update gp_segment_configuration set dbid=9 where dbid=2;
-- trigger failover
select gp_request_fts_probe_scan();
-- wait for content 0 (earlier mirror, now primary) to finish the promotion
0U: select 1;
-- Quit this utility mode session, as need to start fresh one below
0Uq:
-- generate recover config file
select generate_recover_config_file(
(select datadir from gp_segment_configuration c where c.role='m' and c.content=1),
(select port from gp_segment_configuration c where c.role='m' and c.content=1)::text);
-- recover from config file
-- recover from config file, only seg with content=1 will be recovered
!\retcode gprecoverseg -a -i /tmp/recover_config_file;
-- after gprecoverseg -i, the down segemnt should be up
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册