mirror of https://github.com/citusdata/citus.git
Fix tenant isolation failure tests
parent
ead9d28835
commit
6aee8f35a6
|
@ -10,6 +10,7 @@ SET SEARCH_PATH = tenant_isolation;
|
||||||
SET citus.shard_count TO 2;
|
SET citus.shard_count TO 2;
|
||||||
SET citus.next_shard_id TO 300;
|
SET citus.next_shard_id TO 300;
|
||||||
SET citus.shard_replication_factor TO 1;
|
SET citus.shard_replication_factor TO 1;
|
||||||
|
SET citus.max_adaptive_executor_pool_size TO 1;
|
||||||
SELECT pg_backend_pid() as pid \gset
|
SELECT pg_backend_pid() as pid \gset
|
||||||
SELECT citus.mitmproxy('conn.allow()');
|
SELECT citus.mitmproxy('conn.allow()');
|
||||||
mitmproxy
|
mitmproxy
|
||||||
|
@ -59,7 +60,7 @@ SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
ERROR: connection not open
|
ERROR: connection not open
|
||||||
CONTEXT: while executing command on localhost:xxxxx
|
CONTEXT: while executing command on localhost:xxxxx
|
||||||
-- cancellation on colocated table creation
|
-- cancellation on colocated table creation
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE tenant_isolation.table_2").after(1).cancel(' || :pid || ')');
|
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE tenant_isolation.table_2").cancel(' || :pid || ')');
|
||||||
mitmproxy
|
mitmproxy
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -68,17 +69,16 @@ SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE tenant_isolation.table_
|
||||||
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
ERROR: canceling statement due to user request
|
ERROR: canceling statement due to user request
|
||||||
-- failure on colocated table population
|
-- failure on colocated table population
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="INSERT INTO tenant_isolation.table_2").after(2).kill()');
|
SELECT citus.mitmproxy('conn.onQuery(query="worker_split_copy\(302").kill()');
|
||||||
mitmproxy
|
mitmproxy
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
ERROR: connection not open
|
ERROR: connection to the remote node localhost:xxxxx failed with the following error: connection not open
|
||||||
CONTEXT: while executing command on localhost:xxxxx
|
|
||||||
-- cancellation on colocated table population
|
-- cancellation on colocated table population
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="INSERT INTO tenant_isolation.table_2").cancel(' || :pid || ')');
|
SELECT citus.mitmproxy('conn.onQuery(query="worker_split_copy\(302").cancel(' || :pid || ')');
|
||||||
mitmproxy
|
mitmproxy
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -94,8 +94,7 @@ SELECT citus.mitmproxy('conn.onQuery(query="ALTER TABLE tenant_isolation.table_2
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
ERROR: connection not open
|
ERROR: connection to the remote node localhost:xxxxx failed with the following error: connection not open
|
||||||
CONTEXT: while executing command on localhost:xxxxx
|
|
||||||
-- cancellation on colocated table constraints
|
-- cancellation on colocated table constraints
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="ALTER TABLE tenant_isolation.table_2 ADD CONSTRAINT").after(2).cancel(' || :pid || ')');
|
SELECT citus.mitmproxy('conn.onQuery(query="ALTER TABLE tenant_isolation.table_2 ADD CONSTRAINT").after(2).cancel(' || :pid || ')');
|
||||||
mitmproxy
|
mitmproxy
|
||||||
|
@ -116,7 +115,7 @@ SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
ERROR: connection not open
|
ERROR: connection not open
|
||||||
CONTEXT: while executing command on localhost:xxxxx
|
CONTEXT: while executing command on localhost:xxxxx
|
||||||
-- cancellation on table creation
|
-- cancellation on table creation
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE tenant_isolation.table_1").after(1).cancel(' || :pid || ')');
|
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE tenant_isolation.table_1").cancel(' || :pid || ')');
|
||||||
mitmproxy
|
mitmproxy
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -125,17 +124,16 @@ SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE tenant_isolation.table_
|
||||||
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
ERROR: canceling statement due to user request
|
ERROR: canceling statement due to user request
|
||||||
-- failure on table population
|
-- failure on table population
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="INSERT INTO tenant_isolation.table_1").after(2).kill()');
|
SELECT citus.mitmproxy('conn.onQuery(query="worker_split_copy\(300").kill()');
|
||||||
mitmproxy
|
mitmproxy
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
ERROR: connection not open
|
ERROR: connection to the remote node localhost:xxxxx failed with the following error: connection not open
|
||||||
CONTEXT: while executing command on localhost:xxxxx
|
|
||||||
-- cancellation on table population
|
-- cancellation on table population
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="INSERT INTO tenant_isolation.table_1").cancel(' || :pid || ')');
|
SELECT citus.mitmproxy('conn.onQuery(query="worker_split_copy\(300").cancel(' || :pid || ')');
|
||||||
mitmproxy
|
mitmproxy
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -151,8 +149,7 @@ SELECT citus.mitmproxy('conn.onQuery(query="ALTER TABLE tenant_isolation.table_1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
ERROR: connection not open
|
ERROR: connection to the remote node localhost:xxxxx failed with the following error: connection not open
|
||||||
CONTEXT: while executing command on localhost:xxxxx
|
|
||||||
-- cancellation on table constraints
|
-- cancellation on table constraints
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="ALTER TABLE tenant_isolation.table_1 ADD CONSTRAINT").after(2).cancel(' || :pid || ')');
|
SELECT citus.mitmproxy('conn.onQuery(query="ALTER TABLE tenant_isolation.table_1 ADD CONSTRAINT").after(2).cancel(' || :pid || ')');
|
||||||
mitmproxy
|
mitmproxy
|
||||||
|
@ -323,8 +320,8 @@ DO LANGUAGE plpgsql
|
||||||
$$
|
$$
|
||||||
BEGIN
|
BEGIN
|
||||||
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
EXCEPTION WHEN OTHERS THEN
|
EXCEPTION WHEN OTHERS THEN
|
||||||
RAISE 'Command failed to execute';
|
RAISE 'Command failed to execute';
|
||||||
END;
|
END;
|
||||||
$$;
|
$$;
|
||||||
ERROR: Command failed to execute
|
ERROR: Command failed to execute
|
||||||
|
|
|
@ -12,6 +12,7 @@ SET SEARCH_PATH = tenant_isolation;
|
||||||
SET citus.shard_count TO 2;
|
SET citus.shard_count TO 2;
|
||||||
SET citus.next_shard_id TO 300;
|
SET citus.next_shard_id TO 300;
|
||||||
SET citus.shard_replication_factor TO 1;
|
SET citus.shard_replication_factor TO 1;
|
||||||
|
SET citus.max_adaptive_executor_pool_size TO 1;
|
||||||
SELECT pg_backend_pid() as pid \gset
|
SELECT pg_backend_pid() as pid \gset
|
||||||
SELECT citus.mitmproxy('conn.allow()');
|
SELECT citus.mitmproxy('conn.allow()');
|
||||||
|
|
||||||
|
@ -41,15 +42,15 @@ SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE tenant_isolation.table_
|
||||||
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
|
|
||||||
-- cancellation on colocated table creation
|
-- cancellation on colocated table creation
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE tenant_isolation.table_2").after(1).cancel(' || :pid || ')');
|
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE tenant_isolation.table_2").cancel(' || :pid || ')');
|
||||||
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
|
|
||||||
-- failure on colocated table population
|
-- failure on colocated table population
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="INSERT INTO tenant_isolation.table_2").after(2).kill()');
|
SELECT citus.mitmproxy('conn.onQuery(query="worker_split_copy\(302").kill()');
|
||||||
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
|
|
||||||
-- cancellation on colocated table population
|
-- cancellation on colocated table population
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="INSERT INTO tenant_isolation.table_2").cancel(' || :pid || ')');
|
SELECT citus.mitmproxy('conn.onQuery(query="worker_split_copy\(302").cancel(' || :pid || ')');
|
||||||
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
|
|
||||||
-- failure on colocated table constraints
|
-- failure on colocated table constraints
|
||||||
|
@ -66,15 +67,15 @@ SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE tenant_isolation.table_
|
||||||
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
|
|
||||||
-- cancellation on table creation
|
-- cancellation on table creation
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE tenant_isolation.table_1").after(1).cancel(' || :pid || ')');
|
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE tenant_isolation.table_1").cancel(' || :pid || ')');
|
||||||
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
|
|
||||||
-- failure on table population
|
-- failure on table population
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="INSERT INTO tenant_isolation.table_1").after(2).kill()');
|
SELECT citus.mitmproxy('conn.onQuery(query="worker_split_copy\(300").kill()');
|
||||||
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
|
|
||||||
-- cancellation on table population
|
-- cancellation on table population
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="INSERT INTO tenant_isolation.table_1").cancel(' || :pid || ')');
|
SELECT citus.mitmproxy('conn.onQuery(query="worker_split_copy\(300").cancel(' || :pid || ')');
|
||||||
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
SELECT isolate_tenant_to_new_shard('table_1', 5, 'CASCADE');
|
||||||
|
|
||||||
-- failure on table constraints
|
-- failure on table constraints
|
||||||
|
|
Loading…
Reference in New Issue