Skip to content

Commit

Permalink
Revert "Switch to gptoolkit"
Browse files Browse the repository at this point in the history
This reverts commit d24ee4d.
  • Loading branch information
silent-observer committed Nov 22, 2024
1 parent 5b15ca3 commit 63d12de
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
12 changes: 10 additions & 2 deletions tests/regress/expected/test_activetable_limit.out
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ INSERT INTO a02 values(generate_series(0, 500));
INSERT INTO a03 values(generate_series(0, 500));
\c test_tablenum_limit_02
CREATE EXTENSION diskquota;
-- we only read the current log file
CREATE EXTERNAL WEB TABLE segment_logs(line text)
EXECUTE 'if [ -d "$GP_SEG_DATADIR/pg_log" ]; then
cat $GP_SEG_DATADIR/pg_log/$(ls -Art $GP_SEG_DATADIR/pg_log | tail -n 1)
else
cat $GP_SEG_DATADIR/log/$(ls -Art $GP_SEG_DATADIR/log | tail -n 1)
fi'
ON ALL FORMAT 'TEXT' (DELIMITER 'OFF');
CREATE SCHEMA s;
SELECT diskquota.set_schema_quota('s', '1 MB');
set_schema_quota
Expand Down Expand Up @@ -41,7 +49,7 @@ 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.
SELECT count(*) FROM gp_toolkit.__gp_log_segment_ext JOIN pg_stat_activity ON logsession = 'con'||sess_id WHERE pid = pg_backend_pid() AND logmessage LIKE '%the number of active tables reached the limit%';
SELECT count(*) FROM segment_logs WHERE line LIKE '%the number of active tables reached the limit%';
count
-------
3
Expand All @@ -65,7 +73,7 @@ SELECT count(*) FROM s.t1;
-- altered reloid cache overflow check. expected warning.
VACUUM FULL;
WARNING: [diskquota] the number of altered reloid cache entries reached the limit, please increase the GUC value for diskquota.max_active_tables.
SELECT count(*) FROM gp_toolkit.__gp_log_segment_ext JOIN pg_stat_activity ON logsession = 'con'||sess_id WHERE pid = pg_backend_pid() AND logmessage LIKE '%the number of altered reloid cache entries reached the limit%';
SELECT count(*) FROM segment_logs WHERE line LIKE '%the number of altered reloid cache entries reached the limit%';
count
-------
3
Expand Down
10 changes: 9 additions & 1 deletion tests/regress/expected/test_rejectmap_limit.out
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ SELECT diskquota.wait_for_worker_new_epoch();
t
(1 row)

-- we only read the current log file
CREATE EXTERNAL WEB TABLE master_log(line text)
EXECUTE 'if [ -d "$GP_SEG_DATADIR/pg_log" ]; then
cat $GP_SEG_DATADIR/pg_log/$(ls -Art $GP_SEG_DATADIR/pg_log | tail -n 1)
else
cat $GP_SEG_DATADIR/log/$(ls -Art $GP_SEG_DATADIR/log | tail -n 1)
fi'
ON MASTER FORMAT 'TEXT' (DELIMITER 'OFF');
CREATE SCHEMA s1;
CREATE SCHEMA s2;
CREATE SCHEMA s3;
Expand Down Expand Up @@ -70,7 +78,7 @@ SELECT diskquota.wait_for_worker_new_epoch();
t
(1 row)

SELECT count(*) FROM gp_toolkit.__gp_log_master_ext WHERE logmessage LIKE '%the number of local quota reject map entries reached the limit%' AND logmessage NOT LIKE '%LOG%';
SELECT count(*) FROM master_log WHERE line LIKE '%the number of local quota reject map entries reached the limit%' AND line NOT LIKE '%LOG%';
count
-------
1
Expand Down
12 changes: 10 additions & 2 deletions tests/regress/sql/test_activetable_limit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ INSERT INTO a03 values(generate_series(0, 500));

\c test_tablenum_limit_02
CREATE EXTENSION diskquota;
-- we only read the current log file
CREATE EXTERNAL WEB TABLE segment_logs(line text)
EXECUTE 'if [ -d "$GP_SEG_DATADIR/pg_log" ]; then
cat $GP_SEG_DATADIR/pg_log/$(ls -Art $GP_SEG_DATADIR/pg_log | tail -n 1)
else
cat $GP_SEG_DATADIR/log/$(ls -Art $GP_SEG_DATADIR/log | tail -n 1)
fi'
ON ALL FORMAT 'TEXT' (DELIMITER 'OFF');

CREATE SCHEMA s;
SELECT diskquota.set_schema_quota('s', '1 MB');
Expand All @@ -30,7 +38,7 @@ SELECT diskquota.wait_for_worker_new_epoch();
CREATE TABLE s.t1 (a int, b int) DISTRIBUTED BY (a)
PARTITION BY RANGE (b) ( START (0) END (10) EVERY (1) );

SELECT count(*) FROM gp_toolkit.__gp_log_segment_ext JOIN pg_stat_activity ON logsession = 'con'||sess_id WHERE pid = pg_backend_pid() AND logmessage LIKE '%the number of active tables reached the limit%';
SELECT count(*) FROM segment_logs WHERE line LIKE '%the number of active tables reached the limit%';

CREATE TABLE s.t2(i int) DISTRIBUTED BY (i);
INSERT INTO s.t2 SELECT generate_series(1, 100000);
Expand All @@ -43,7 +51,7 @@ SELECT count(*) FROM s.t1;
-- altered reloid cache overflow check. expected warning.
VACUUM FULL;

SELECT count(*) FROM gp_toolkit.__gp_log_segment_ext JOIN pg_stat_activity ON logsession = 'con'||sess_id WHERE pid = pg_backend_pid() AND logmessage LIKE '%the number of altered reloid cache entries reached the limit%';
SELECT count(*) FROM segment_logs WHERE line LIKE '%the number of altered reloid cache entries reached the limit%';

DROP EXTENSION diskquota;

Expand Down
10 changes: 9 additions & 1 deletion tests/regress/sql/test_rejectmap_limit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ CREATE DATABASE test_reject_map_limit_01;
\c test_reject_map_limit_01
CREATE EXTENSION diskquota;
SELECT diskquota.wait_for_worker_new_epoch();
-- we only read the current log file
CREATE EXTERNAL WEB TABLE master_log(line text)
EXECUTE 'if [ -d "$GP_SEG_DATADIR/pg_log" ]; then
cat $GP_SEG_DATADIR/pg_log/$(ls -Art $GP_SEG_DATADIR/pg_log | tail -n 1)
else
cat $GP_SEG_DATADIR/log/$(ls -Art $GP_SEG_DATADIR/log | tail -n 1)
fi'
ON MASTER FORMAT 'TEXT' (DELIMITER 'OFF');

CREATE SCHEMA s1;
CREATE SCHEMA s2;
Expand Down Expand Up @@ -40,7 +48,7 @@ INSERT INTO s5.a SELECT generate_series(1,100000);

SELECT diskquota.wait_for_worker_new_epoch();

SELECT count(*) FROM gp_toolkit.__gp_log_master_ext WHERE logmessage LIKE '%the number of local quota reject map entries reached the limit%' AND logmessage NOT LIKE '%LOG%';
SELECT count(*) FROM master_log WHERE line LIKE '%the number of local quota reject map entries reached the limit%' AND line NOT LIKE '%LOG%';

DROP EXTENSION diskquota;

Expand Down

0 comments on commit 63d12de

Please sign in to comment.