提交 a4b2fea3 编写于 作者: A Ashwin Agrawal

Avoid full cluster restarts in GDD tests and other cleanup.

To enable or disable the GUC gp_enable_global_deadlock_detector,
restart is required. But this GUC is only used on master, so just
restart master instead of full cluster. This helps to cut-down the
test time by a min. Also, in process remove the pg_sleep(2) calls, as
GUCs gp_enable_global_deadlock_detector and
gp_global_deadlock_detector_period can be set sametime and hence don't
need separate time to reload the config and waste time.

Also, removing prepare-for-local as only one test exists for local
locks which is local-deadlock-03, hence directly prepare for the same
inside that sql file.
上级 261d4d64
0: show gp_enable_global_deadlock_detector;
include: helpers/server_helpers.sql;
CREATE
ALTER SYSTEM RESET gp_enable_global_deadlock_detector;
ALTER
ALTER SYSTEM RESET gp_global_deadlock_detector_period;
ALTER
-- Use utility session on seg 0 to restart master. This way avoids the
-- situation where session issuing the restart doesn't disappear
-- itself.
1U:SELECT pg_ctl(dir, 'restart') from datadir;
pg_ctl
------------------------------------------------------------------------------------------------------
waiting for server to shut down done
server stopped
waiting for server to start done
server started
(1 row)
-- Start new session on master to make sure it has fully completed
-- recovery and up and running again.
1: SHOW gp_enable_global_deadlock_detector;
gp_enable_global_deadlock_detector
------------------------------------
off
(1 row)
1: SHOW gp_global_deadlock_detector_period;
gp_global_deadlock_detector_period
------------------------------------
2min
(1 row)
-- gdd can also detect local deadlocks, however it might break at
-- different node with the local deadlock detector. To make the local
-- deadlock testcases stable we reset the gdd period to 2min so should
-- not be triggered during the local deadlock tests.
ALTER SYSTEM RESET gp_global_deadlock_detector_period;
ALTER
SELECT pg_reload_conf();
pg_reload_conf
----------------
t
(1 row)
-- start new session, which should always have newly reflected value
1: SHOW gp_global_deadlock_detector_period;
gp_global_deadlock_detector_period
------------------------------------
2min
(1 row)
DROP TABLE IF EXISTS t03;
DROP
CREATE TABLE t03 (id int, val int);
......
-- gdd can also detect local deadlocks, however it might break at different
-- node with the local deadlock detecotr. To make the local deadlock testcases
-- stable we reset the gdd period to 2min so should not be triggered during
-- the local deadlock tests.
-- start_ignore
! gpconfig -r gp_global_deadlock_detector_period;
20180821:16:56:46:029243 gpconfig:nyu-vm-desktop:u-[INFO]:-completed successfully with parameters '-r gp_global_deadlock_detector_period'
! gpstop -u;
20180821:16:56:46:029430 gpstop:nyu-vm-desktop:u-[INFO]:-Starting gpstop with args: -u
20180821:16:56:46:029430 gpstop:nyu-vm-desktop:u-[INFO]:-Gathering information and validating the environment...
20180821:16:56:46:029430 gpstop:nyu-vm-desktop:u-[INFO]:-Obtaining Greenplum Master catalog information
20180821:16:56:46:029430 gpstop:nyu-vm-desktop:u-[INFO]:-Obtaining Segment details from master...
20180821:16:56:46:029430 gpstop:nyu-vm-desktop:u-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 6.0.0-alpha.0+dev.9425.g39e7098837 build dev-oss'
20180821:16:56:46:029430 gpstop:nyu-vm-desktop:u-[INFO]:-Signalling all postmaster processes to reload
.
-- end_ignore
-- the new setting need some time to be loaded
SELECT pg_sleep(2);
pg_sleep
----------
(1 row)
SHOW gp_global_deadlock_detector_period;
gp_global_deadlock_detector_period
------------------------------------
2min
(1 row)
include: helpers/server_helpers.sql;
CREATE
-- t0r is the reference table to provide the data distribution info.
DROP TABLE IF EXISTS t0p;
......@@ -60,30 +62,38 @@ SELECT segid(2,10) is not null;
t
(1 row)
-- start_ignore
! gpconfig -c gp_global_deadlock_detector_period -v 10;
20180313:15:24:17:085127 gpconfig:zlv:gpadmin-[INFO]:-completed successfully with parameters '-c gp_global_deadlock_detector_period -v 10'
! gpstop -u;
20180313:15:24:17:085283 gpstop:zlv:gpadmin-[INFO]:-Starting gpstop with args: -u
20180313:15:24:17:085283 gpstop:zlv:gpadmin-[INFO]:-Gathering information and validating the environment...
20180313:15:24:17:085283 gpstop:zlv:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20180313:15:24:17:085283 gpstop:zlv:gpadmin-[INFO]:-Obtaining Segment details from master...
20180313:15:24:17:085283 gpstop:zlv:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 6.0.0-alpha.0+dev.3836.g671368b build dev-oss'
20180313:15:24:17:085283 gpstop:zlv:gpadmin-[INFO]:-Signalling all postmaster processes to reload
.
-- table to just store the master's data directory path on segment.
CREATE TABLE datadir(a int, dir text);
CREATE
INSERT INTO datadir select 1,datadir from gp_segment_configuration where role='p' and content=-1;
INSERT 1
-- end_ignore
ALTER SYSTEM SET gp_enable_global_deadlock_detector TO on;
ALTER
ALTER SYSTEM SET gp_global_deadlock_detector_period TO 5;
ALTER
-- the new setting need some time to be loaded
SELECT pg_sleep(2);
pg_sleep
----------
-- Use utility session on seg 0 to restart master. This way avoids the
-- situation where session issuing the restart doesn't disappear
-- itself.
1U:SELECT pg_ctl(dir, 'restart') from datadir;
pg_ctl
------------------------------------------------------------------------------------------------------
waiting for server to shut down done
server stopped
waiting for server to start done
server started
(1 row)
SHOW gp_global_deadlock_detector_period;
-- Start new session on master to make sure it has fully completed
-- recovery and up and running again.
1: SHOW gp_enable_global_deadlock_detector;
gp_enable_global_deadlock_detector
------------------------------------
on
(1 row)
1: SHOW gp_global_deadlock_detector_period;
gp_global_deadlock_detector_period
------------------------------------
10s
5s
(1 row)
......@@ -32,8 +32,8 @@ test: gdd/planner_insert_while_vacuum_drop
test: gdd/update-deadlock-root-leaf-concurrent-op
test: gdd/dml_locks_only_targeted_table_in_query
# this resets the gp_global_deadlock_detector_period guc hence should be last
test: gdd/prepare-for-local
# this resets the gp_global_deadlock_detector_period guc hence should
# be last in the group.
test: gdd/local-deadlock-03
# gdd end
test: gdd/end
......
-- start_ignore
! gpconfig -c gp_enable_global_deadlock_detector -v off;
! gpstop -rai;
-- end_ignore
0: show gp_enable_global_deadlock_detector;
include: helpers/server_helpers.sql;
ALTER SYSTEM RESET gp_enable_global_deadlock_detector;
ALTER SYSTEM RESET gp_global_deadlock_detector_period;
-- Use utility session on seg 0 to restart master. This way avoids the
-- situation where session issuing the restart doesn't disappear
-- itself.
1U:SELECT pg_ctl(dir, 'restart') from datadir;
-- Start new session on master to make sure it has fully completed
-- recovery and up and running again.
1: SHOW gp_enable_global_deadlock_detector;
1: SHOW gp_global_deadlock_detector_period;
-- gdd can also detect local deadlocks, however it might break at
-- different node with the local deadlock detector. To make the local
-- deadlock testcases stable we reset the gdd period to 2min so should
-- not be triggered during the local deadlock tests.
ALTER SYSTEM RESET gp_global_deadlock_detector_period;
SELECT pg_reload_conf();
-- start new session, which should always have newly reflected value
1: SHOW gp_global_deadlock_detector_period;
DROP TABLE IF EXISTS t03;
CREATE TABLE t03 (id int, val int);
INSERT INTO t03 (id, val) SELECT i, i FROM generate_series(1, 100) i;
......
-- gdd can also detect local deadlocks, however it might break at different
-- node with the local deadlock detecotr. To make the local deadlock testcases
-- stable we reset the gdd period to 2min so should not be triggered during
-- the local deadlock tests.
-- start_ignore
! gpconfig -r gp_global_deadlock_detector_period;
! gpstop -u;
-- end_ignore
-- the new setting need some time to be loaded
SELECT pg_sleep(2);
SHOW gp_global_deadlock_detector_period;
-- start_ignore
! gpconfig -c gp_enable_global_deadlock_detector -v on;
! gpstop -rai;
-- end_ignore
include: helpers/server_helpers.sql;
-- t0r is the reference table to provide the data distribution info.
DROP TABLE IF EXISTS t0p;
......@@ -52,12 +49,18 @@ SELECT segid(0,10) is not null;
SELECT segid(1,10) is not null;
SELECT segid(2,10) is not null;
-- start_ignore
! gpconfig -c gp_global_deadlock_detector_period -v 10;
! gpstop -u;
-- end_ignore
-- table to just store the master's data directory path on segment.
CREATE TABLE datadir(a int, dir text);
INSERT INTO datadir select 1,datadir from gp_segment_configuration where role='p' and content=-1;
-- the new setting need some time to be loaded
SELECT pg_sleep(2);
ALTER SYSTEM SET gp_enable_global_deadlock_detector TO on;
ALTER SYSTEM SET gp_global_deadlock_detector_period TO 5;
SHOW gp_global_deadlock_detector_period;
-- Use utility session on seg 0 to restart master. This way avoids the
-- situation where session issuing the restart doesn't disappear
-- itself.
1U:SELECT pg_ctl(dir, 'restart') from datadir;
-- Start new session on master to make sure it has fully completed
-- recovery and up and running again.
1: SHOW gp_enable_global_deadlock_detector;
1: SHOW gp_global_deadlock_detector_period;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册