提交 64f38057 编写于 作者: A Ashwin Agrawal

Move test_outof_shmm_exit_slots to ICW.

The version in tinc was anyways broken long time back ever since
sub-transactions were correctly dispatched to segments. Wrote new
tests forcing reset of gang during commit-prepared and crossing
MAX_ON_EXITS transactions.
上级 4c33c520
-- 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)
......@@ -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
......
-- 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;
"""
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
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();
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;
"""
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")
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册