diff --git a/src/test/regress/expected/not_out_of_shmem_exit_slots.out b/src/test/regress/expected/not_out_of_shmem_exit_slots.out new file mode 100644 index 0000000000000000000000000000000000000000..58b5b84d83c567fed0a44be6fd4c584c8093128d --- /dev/null +++ b/src/test/regress/expected/not_out_of_shmem_exit_slots.out @@ -0,0 +1,257 @@ +-- Used to be a bug where we release the gangs and reset context. The +-- subsequent retry succeeds with the new gang. When resetting the +-- session, as the warning message says, we drop ongoing temporary +-- namespace. However, whenever new temporary namespace is created, we +-- install shmem_exit callback for this namespace clean up. We earlier +-- missed to uninstall this callback on resetting the gang. That was +-- the reason this test exposed out of shmem_exit slots. Currently +-- MAX_ON_EXITS is set to 20 hence creates 20 transactions. Erroring +-- commit_prepared first time is used as vehicle to trigger gang +-- reset. +-- start_matchsubs +-- m/WARNING:.*Any temporary tables for this session have been dropped because the gang was disconnected/ +-- s/session id \=\s*\d+/session id \= DUMMY/gm +-- end_matchsubs +CREATE TABLE foo(a int, b int); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' 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. +-- 1 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000582. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 142) +-- 2 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000588. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 143) +-- 3 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000594. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 144) +-- 4 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000600. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 145) +-- 5 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000606. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 146) +-- 6 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000612. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 147) +-- 7 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000618. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 148) +-- 8 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000624. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 149) +-- 9 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000630. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 150) +-- 10 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000636. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 151) +-- 11 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000642. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 152) +-- 12 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000648. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 153) +-- 13 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000654. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 154) +-- 14 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000660. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 155) +-- 15 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000666. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 156) +-- 16 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000672. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 157) +-- 17 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000678. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 158) +-- 18 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000684. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 159) +-- 19 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000690. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 160) +-- 20 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' 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. +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; +WARNING: the distributed transaction 'Commit Prepared' broadcast failed to one or more segments for gid = 1518745234-0000000696. Retrying ... try 1 +NOTICE: Releasing segworker group to retry broadcast. +WARNING: Any temporary tables for this session have been dropped because the gang was disconnected (session id = 161) diff --git a/src/test/regress/greenplum_schedule b/src/test/regress/greenplum_schedule index 15a39108b179ef869a75dc07d089e57641bd33ad..2ae1f7ec42da877b0368498c235bce394e9f7e22 100755 --- a/src/test/regress/greenplum_schedule +++ b/src/test/regress/greenplum_schedule @@ -94,7 +94,7 @@ test: wrkloadadmin test: gp_toolkit test: gp_toolkit_ao_funcs trig auth_constraint role portals_updatable plpgsql_cache timeseries pg_stat_last_operation gp_numeric_agg partindex_test partition_pruning runtime_stats -test: rle rle_delta dsp +test: rle rle_delta dsp not_out_of_shmem_exit_slots # direct dispatch tests test: direct_dispatch bfv_dd bfv_dd_multicolumn bfv_dd_types diff --git a/src/test/regress/sql/not_out_of_shmem_exit_slots.sql b/src/test/regress/sql/not_out_of_shmem_exit_slots.sql new file mode 100644 index 0000000000000000000000000000000000000000..de5bf5d2e8e69bb1c5e12921eb31e826227abe9a --- /dev/null +++ b/src/test/regress/sql/not_out_of_shmem_exit_slots.sql @@ -0,0 +1,176 @@ +-- Used to be a bug where we release the gangs and reset context. The +-- subsequent retry succeeds with the new gang. When resetting the +-- session, as the warning message says, we drop ongoing temporary +-- namespace. However, whenever new temporary namespace is created, we +-- install shmem_exit callback for this namespace clean up. We earlier +-- missed to uninstall this callback on resetting the gang. That was +-- the reason this test exposed out of shmem_exit slots. Currently +-- MAX_ON_EXITS is set to 20 hence creates 20 transactions. Erroring +-- commit_prepared first time is used as vehicle to trigger gang +-- reset. + +-- start_matchsubs +-- m/WARNING:.*Any temporary tables for this session have been dropped because the gang was disconnected/ +-- s/session id \=\s*\d+/session id \= DUMMY/gm +-- end_matchsubs + +CREATE TABLE foo(a int, b int); +-- 1 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 2 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 3 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 4 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 5 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 6 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 7 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 8 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 9 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 10 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 11 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 12 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 13 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 14 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 15 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 16 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 17 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 18 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 19 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; + +-- 20 +CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; +SET debug_dtm_action_segment=1; +SET debug_dtm_action_target=protocol; +SET debug_dtm_action_protocol=commit_prepared; +SET debug_dtm_action=fail_begin_command; +DROP TABLE foo_stg; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/transaction_management/mpp19973/__init__.py b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/transaction_management/mpp19973/__init__.py deleted file mode 100644 index f6dbd2ad9cb06de07152f4a80e5abf93b240c59a..0000000000000000000000000000000000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/transaction_management/mpp19973/__init__.py +++ /dev/null @@ -1,46 +0,0 @@ -""" -Copyright (c) 2004-Present Pivotal Software, Inc. - -This program and the accompanying materials are made available under -the terms of the under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -import tinctest - -from mpp.lib.PSQL import PSQL - -def table_exists(table_name, *args, **kwargs): - """ - Checks if a table exists in the catalog. - """ - - # TODO (dmeister): This creates an SQL injection, but it should not - # be a problem for this purpose. - table_exists_text_count = PSQL.run_sql_command( - "SELECT 'table exists' FROM pg_class WHERE relname='%s'" % (table_name), - *args, **kwargs).count("table exists") - print table_exists_text_count - return table_exists_text_count == 2 - -def function_exists(function_name, *args, **kwargs): - """ - Checks if a function exists in the catalog - """ - - # TODO (dmeister): This creates an SQL injection, but it should not - # be a problem for this purpose. - function_exists_text_count = PSQL.run_sql_command( - "SELECT 'function exists' FROM pg_proc WHERE proname='%s'" % (function_name), - *args, **kwargs).count("function exists") - return function_exists_text_count == 2 - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/transaction_management/mpp19973/mpp19973.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/transaction_management/mpp19973/mpp19973.sql deleted file mode 100644 index 53ed84520f950ec27401bb746430ffac287da54b..0000000000000000000000000000000000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/transaction_management/mpp19973/mpp19973.sql +++ /dev/null @@ -1,69 +0,0 @@ -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - -CREATE TEMP TABLE foo_stg AS SELECT * FROM foo; -SELECT testfn(); - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/transaction_management/mpp19973/mpp19973_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/transaction_management/mpp19973/mpp19973_setup.sql deleted file mode 100644 index 26290545ca671f4243757579c4a4e575680edfe3..0000000000000000000000000000000000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/transaction_management/mpp19973/mpp19973_setup.sql +++ /dev/null @@ -1,16 +0,0 @@ -DROP TABLE IF EXISTS foo; -CREATE TABLE foo(a, b) AS VALUES(1, 10), (2, 20); - -CREATE OR REPLACE FUNCTION testfn() RETURNS bool AS $$ -DECLARE - -BEGIN - BEGIN - CREATE TEMP TABLE foo_stg2 AS SELECT 10/0 FROM foo; - EXCEPTION - WHEN division_by_zero THEN RETURN false; - RETURN false; - END; - RETURN true; -END; -$$ LANGUAGE plpgsql; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/transaction_management/mpp19973/test_mpp19973.py b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/transaction_management/mpp19973/test_mpp19973.py deleted file mode 100644 index 8b8b47343c5b6cd4d3a68231018513ed09d4f19d..0000000000000000000000000000000000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/transaction_management/mpp19973/test_mpp19973.py +++ /dev/null @@ -1,64 +0,0 @@ -""" -Copyright (c) 2004-Present Pivotal Software, Inc. - -This program and the accompanying materials are made available under -the terms of the under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -import os -import sys - -from mpp.models import MPPTestCase -from tinctest.lib import local_path - -from mpp.lib.PSQL import PSQL - -from mpp.gpdb.tests.storage.transaction_management.mpp19973 import table_exists, function_exists - -class mpp19973(MPPTestCase): - """ - - @description Automation for MPP-19973 - @tags mpp19973 - @product_version gpdb: [4.2.6.1- main] - """ - - def test_outof_shmm_exit_slots(self): - """ - The issue of MPP-19973 is that a shmem exit callback to reset - a temporary namespace is not removed when the temporary namespace is - reset. - - In situations, where a temporary namespace is multiple times reset - because of an exception in a subtransaction, the callbacks - use up all shmem_exit slots. - """ - - sql_setup_file = local_path('mpp19973_setup.sql') - PSQL.run_sql_file(sql_file=sql_setup_file) - - # Test case setup verification - self.assertTrue(table_exists("foo")) - self.assertTrue(function_exists("testfn")) - - sql_file = local_path('mpp19973.sql') - out_file = local_path('mpp19973.out') - PSQL.run_sql_file(sql_file=sql_file, - out_file=out_file, output_to_file=True) - - # There will be different error messages in the output, but - # we should not run out of shmem exit slots. - self.assertNotRegexpMatches(open(out_file).read(), - "out of on_shmem_exit slots", - "Database should not run out of shmem_exit slots") -