Skip to content

Commit

Permalink
make tests more stable
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightMurloc committed Dec 5, 2023
1 parent 9844e59 commit 8af2777
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 23 deletions.
39 changes: 24 additions & 15 deletions tests/regress/expected/test_activetable_limit.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- table in 'diskquota not enabled database' should not be activetable
\! gpconfig -c diskquota.max_active_tables -v 5 > /dev/null
\! gpconfig -c diskquota.naptime -v 2 > /dev/null
\! gpconfig -c diskquota.naptime -v 1 > /dev/null
\! gpstop -arf > /dev/null
\c
CREATE DATABASE test_tablenum_limit_01;
Expand All @@ -27,22 +27,32 @@ SELECT diskquota.wait_for_worker_new_epoch();
t
(1 row)

-- the other two active tables are in a different database
CREATE TABLE s.t1(i int) DISTRIBUTED BY (i); -- activetable = 3
CREATE TABLE s.t2(i int) DISTRIBUTED BY (i); -- activetable = 4
CREATE TABLE s.t3(i int) DISTRIBUTED BY (i); -- activetable = 5. expected warning.
CREATE TABLE s.t4(i int) DISTRIBUTED BY (i);
WARNING: [diskquota] the number of active tables reached the limit, please increase the GUC value for diskquota.max_active_tables. Current diskquota.max_active_tables value: 5 (seg0 127.0.1.1:6002 pid=995937)
WARNING: [diskquota] the number of active tables reached the limit, please increase the GUC value for diskquota.max_active_tables. Current diskquota.max_active_tables value: 5 (seg2 127.0.1.1:6004 pid=995938)
WARNING: [diskquota] the number of active tables reached the limit, please increase the GUC value for diskquota.max_active_tables. Current diskquota.max_active_tables value: 5 (seg1 127.0.1.1:6003 pid=995939)
INSERT INTO s.t4 SELECT generate_series(1, 100000);
-- We create twice as many tables as the limit to ensure that the active_tables table is overflow.
CREATE TABLE s.t1 (a int, b int) DISTRIBUTED BY (a)
PARTITION BY RANGE (b) ( START (0) END (10) EVERY (1) );
NOTICE: CREATE TABLE will create partition "t1_1_prt_1" for table "t1"
NOTICE: CREATE TABLE will create partition "t1_1_prt_2" for table "t1"
NOTICE: CREATE TABLE will create partition "t1_1_prt_3" for table "t1"
NOTICE: CREATE TABLE will create partition "t1_1_prt_4" for table "t1"
NOTICE: CREATE TABLE will create partition "t1_1_prt_5" for table "t1"
NOTICE: CREATE TABLE will create partition "t1_1_prt_6" for table "t1"
NOTICE: CREATE TABLE will create partition "t1_1_prt_7" for table "t1"
NOTICE: CREATE TABLE will create partition "t1_1_prt_8" for table "t1"
NOTICE: CREATE TABLE will create partition "t1_1_prt_9" for table "t1"
NOTICE: CREATE TABLE will create partition "t1_1_prt_10" for table "t1"
WARNING: [diskquota] the number of active tables reached the limit, please increase the GUC value for diskquota.max_active_tables. Current diskquota.max_active_tables value: 5
WARNING: [diskquota] the number of active tables reached the limit, please increase the GUC value for diskquota.max_active_tables. Current diskquota.max_active_tables value: 5 (seg0 127.0.1.1:6002 pid=281310)
WARNING: [diskquota] the number of active tables reached the limit, please increase the GUC value for diskquota.max_active_tables. Current diskquota.max_active_tables value: 5 (seg1 127.0.1.1:6003 pid=281312)
WARNING: [diskquota] the number of active tables reached the limit, please increase the GUC value for diskquota.max_active_tables. Current diskquota.max_active_tables value: 5 (seg2 127.0.1.1:6004 pid=281311)
CREATE TABLE s.t2(i int) DISTRIBUTED BY (i);
INSERT INTO s.t2 SELECT generate_series(1, 100000);
SELECT diskquota.wait_for_worker_new_epoch();
wait_for_worker_new_epoch
---------------------------
t
(1 row)

INSERT INTO s.t1 SELECT generate_series(1, 10); -- should be successful
INSERT INTO s.t1 SELECT a, a from generate_series(0, 9)a; -- should be successful
select count(*) from s.t1;
count
-------
Expand All @@ -51,10 +61,9 @@ select count(*) from s.t1;

-- altered reloid cache overflow check. expected warning.
vacuum full;
WARNING: [diskquota] the number of active tables reached the limit, please increase the GUC value for diskquota.max_active_tables. Current diskquota.max_active_tables value: 5
WARNING: [diskquota] the number of altered reloid cache entries reached the limit, please increase the GUC value for diskquota.max_active_tables. Current diskquota.max_active_tables value: 5 (seg0 127.0.1.1:6002 pid=995937)
WARNING: [diskquota] the number of altered reloid cache entries reached the limit, please increase the GUC value for diskquota.max_active_tables. Current diskquota.max_active_tables value: 5 (seg1 127.0.1.1:6003 pid=995939)
WARNING: [diskquota] the number of altered reloid cache entries reached the limit, please increase the GUC value for diskquota.max_active_tables. Current diskquota.max_active_tables value: 5 (seg2 127.0.1.1:6004 pid=995938)
WARNING: [diskquota] the number of altered reloid cache entries reached the limit, please increase the GUC value for diskquota.max_active_tables. Current diskquota.max_active_tables value: 5 (seg0 127.0.1.1:6002 pid=281310)
WARNING: [diskquota] the number of altered reloid cache entries reached the limit, please increase the GUC value for diskquota.max_active_tables. Current diskquota.max_active_tables value: 5 (seg1 127.0.1.1:6003 pid=281312)
WARNING: [diskquota] the number of altered reloid cache entries reached the limit, please increase the GUC value for diskquota.max_active_tables. Current diskquota.max_active_tables value: 5 (seg2 127.0.1.1:6004 pid=281311)
DROP EXTENSION diskquota;
\c contrib_regression
DROP DATABASE test_tablenum_limit_01;
Expand Down
15 changes: 7 additions & 8 deletions tests/regress/sql/test_activetable_limit.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- table in 'diskquota not enabled database' should not be activetable
\! gpconfig -c diskquota.max_active_tables -v 5 > /dev/null
\! gpconfig -c diskquota.naptime -v 2 > /dev/null
\! gpconfig -c diskquota.naptime -v 1 > /dev/null
\! gpstop -arf > /dev/null

\c
Expand All @@ -25,17 +25,16 @@ SELECT diskquota.set_schema_quota('s', '1 MB');

SELECT diskquota.wait_for_worker_new_epoch();

-- the other two active tables are in a different database
CREATE TABLE s.t1(i int) DISTRIBUTED BY (i); -- activetable = 3
CREATE TABLE s.t2(i int) DISTRIBUTED BY (i); -- activetable = 4
CREATE TABLE s.t3(i int) DISTRIBUTED BY (i); -- activetable = 5. expected warning.
CREATE TABLE s.t4(i int) DISTRIBUTED BY (i);
-- We create twice as many tables as the limit to ensure that the active_tables table is overflow.
CREATE TABLE s.t1 (a int, b int) DISTRIBUTED BY (a)
PARTITION BY RANGE (b) ( START (0) END (10) EVERY (1) );
CREATE TABLE s.t2(i int) DISTRIBUTED BY (i);

INSERT INTO s.t4 SELECT generate_series(1, 100000);
INSERT INTO s.t2 SELECT generate_series(1, 100000);

SELECT diskquota.wait_for_worker_new_epoch();

INSERT INTO s.t1 SELECT generate_series(1, 10); -- should be successful
INSERT INTO s.t1 SELECT a, a from generate_series(0, 9)a; -- should be successful
select count(*) from s.t1;

-- altered reloid cache overflow check. expected warning.
Expand Down

0 comments on commit 8af2777

Please sign in to comment.