blob: 0f65a3224dd616fa2e9cf169f2459d69b6cd07f8 [file] [log] [blame]
-- This test is used to test if the writer gangs will be
-- reused and reader gangs will be cleaned after
-- gp_vmem_idle_resource_timeout. Since we no longer
-- clean up the idle writer gangs after the timeout,
-- no snapshot collision error should occur.
set gp_vmem_idle_resource_timeout to '0.5s';
set gp_snapshotadd_timeout to 0;
create table target_session_id_t(target_session_id int) DISTRIBUTED REPLICATED;
insert into target_session_id_t values(current_setting('gp_session_id')::int);
create table idle_gang_cleaner_t (c1 int, c2 int);
0U: select gp_inject_fault('proc_kill', 'suspend', 2, target_session_id) from target_session_id_t;
select count(*) from idle_gang_cleaner_t a
join idle_gang_cleaner_t b using (c2)
;
-- Start a new session to wait_until_triggered, avoid wait_until_triggered blocking IdleGangTimeoutHandler.
0U: select gp_inject_fault('proc_kill', 'wait_until_triggered', '','','', 1, 1, 1, 2 ,target_session_id) from target_session_id_t;
select count(*) from idle_gang_cleaner_t a
join idle_gang_cleaner_t b using (c2)
;
0U: select gp_inject_fault('proc_kill', 'reset', 2, target_session_id) from target_session_id_t;
drop table target_session_id_t;
drop table idle_gang_cleaner_t;
reset gp_vmem_idle_resource_timeout;
reset gp_snapshotadd_timeout;