forked from greenplum-db/diskquota-archive
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug: diskquota stop working after removing any extension (#379) (#25
) Fix the bug caused by #220: After the user removes any extension, the bgworker in the current database will be stopped. Cherry-picked-from: 8210b78 Co-authored-by: Zhang Hao <hzhang2@vmware.com>
- Loading branch information
Showing
4 changed files
with
60 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
CREATE DATABASE test_drop_db; | ||
\c test_drop_db | ||
CREATE EXTENSION diskquota; | ||
CREATE EXTENSION gp_inject_fault; | ||
SELECT diskquota.init_table_size_table(); | ||
init_table_size_table | ||
----------------------- | ||
|
||
(1 row) | ||
|
||
SELECT diskquota.set_schema_quota(current_schema, '1MB'); | ||
set_schema_quota | ||
------------------ | ||
|
||
(1 row) | ||
|
||
CREATE TABLE t(i int); | ||
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'i' as the Greenplum Database data distribution key for this table. | ||
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. | ||
DROP EXTENSION gp_inject_fault; | ||
-- expect success | ||
INSERT INTO t SELECT generate_series(1, 100000); | ||
SELECT diskquota.wait_for_worker_new_epoch(); | ||
wait_for_worker_new_epoch | ||
--------------------------- | ||
t | ||
(1 row) | ||
|
||
-- expect fail | ||
INSERT INTO t SELECT generate_series(1, 100000); | ||
ERROR: schema's disk space quota exceeded with name: public | ||
DROP EXTENSION diskquota; | ||
\c contrib_regression | ||
DROP DATABASE test_drop_db; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
CREATE DATABASE test_drop_db; | ||
|
||
\c test_drop_db | ||
|
||
CREATE EXTENSION diskquota; | ||
CREATE EXTENSION gp_inject_fault; | ||
SELECT diskquota.init_table_size_table(); | ||
|
||
SELECT diskquota.set_schema_quota(current_schema, '1MB'); | ||
CREATE TABLE t(i int); | ||
|
||
DROP EXTENSION gp_inject_fault; | ||
|
||
-- expect success | ||
INSERT INTO t SELECT generate_series(1, 100000); | ||
SELECT diskquota.wait_for_worker_new_epoch(); | ||
-- expect fail | ||
INSERT INTO t SELECT generate_series(1, 100000); | ||
|
||
DROP EXTENSION diskquota; | ||
|
||
\c contrib_regression | ||
DROP DATABASE test_drop_db; |