Fix cte subquery failure test

pull/2318/head
Murat Tuncer 2018-10-03 12:23:27 +03:00
parent d26b312cad
commit 0a987e9c0e
2 changed files with 38 additions and 51 deletions

View File

@ -51,15 +51,9 @@ FROM
ERROR: server closed the connection unexpectedly ERROR: server closed the connection unexpectedly
This probably means the server terminated abnormally This probably means the server terminated abnormally
before or while processing the request. before or while processing the request.
CONTEXT: while executing command on localhost:57640 CONTEXT: while executing command on localhost:9060
-- kill at the second copy (pull) -- kill at the second copy (pull)
SELECT citus.mitmproxy('conn.allow()'); SELECT citus.mitmproxy('conn.onQuery(query="SELECT user_id FROM cte_failure.events_table_102250").kill()');
mitmproxy
-----------
(1 row)
SELECT citus.mitmproxy('conn.onQuery(query="SELECT user_id FROM").kill()');
mitmproxy mitmproxy
----------- -----------
@ -91,15 +85,9 @@ FROM
WARNING: could not consume data from worker node WARNING: could not consume data from worker node
WARNING: could not consume data from worker node WARNING: could not consume data from worker node
WARNING: could not consume data from worker node WARNING: could not consume data from worker node
ERROR: failed to execute task 2 ERROR: failed to execute task 1
-- kill at the third copy (pull) -- kill at the third copy (pull)
SELECT citus.mitmproxy('conn.allow()');
mitmproxy
-----------
(1 row)
SELECT citus.mitmproxy('conn.onQuery(query="SELECT DISTINCT users_table.user").kill()'); SELECT citus.mitmproxy('conn.onQuery(query="SELECT DISTINCT users_table.user").kill()');
mitmproxy mitmproxy
----------- -----------
@ -131,14 +119,8 @@ FROM
WHERE foo.user_id = cte.user_id; WHERE foo.user_id = cte.user_id;
WARNING: could not consume data from worker node WARNING: could not consume data from worker node
WARNING: could not consume data from worker node WARNING: could not consume data from worker node
ERROR: failed to execute task 2 ERROR: failed to execute task 1
-- cancel at the first copy (push) -- cancel at the first copy (push)
SELECT citus.mitmproxy('conn.allow()');
mitmproxy
-----------
(1 row)
SELECT citus.mitmproxy('conn.onQuery(query="^COPY").cancel(' || :pid || ')'); SELECT citus.mitmproxy('conn.onQuery(query="^COPY").cancel(' || :pid || ')');
mitmproxy mitmproxy
----------- -----------
@ -170,12 +152,6 @@ FROM
WHERE foo.user_id = cte.user_id; WHERE foo.user_id = cte.user_id;
ERROR: canceling statement due to user request ERROR: canceling statement due to user request
-- cancel at the second copy (pull) -- cancel at the second copy (pull)
SELECT citus.mitmproxy('conn.allow()');
mitmproxy
-----------
(1 row)
SELECT citus.mitmproxy('conn.onQuery(query="SELECT user_id FROM").cancel(' || :pid || ')'); SELECT citus.mitmproxy('conn.onQuery(query="SELECT user_id FROM").cancel(' || :pid || ')');
mitmproxy mitmproxy
----------- -----------
@ -207,12 +183,6 @@ FROM
WHERE foo.user_id = cte.user_id; WHERE foo.user_id = cte.user_id;
ERROR: canceling statement due to user request ERROR: canceling statement due to user request
-- cancel at the third copy (pull) -- cancel at the third copy (pull)
SELECT citus.mitmproxy('conn.allow()');
mitmproxy
-----------
(1 row)
SELECT citus.mitmproxy('conn.onQuery(query="SELECT DISTINCT users_table.user").cancel(' || :pid || ')'); SELECT citus.mitmproxy('conn.onQuery(query="SELECT DISTINCT users_table.user").cancel(' || :pid || ')');
mitmproxy mitmproxy
----------- -----------
@ -267,12 +237,6 @@ SELECT * FROM users_table ORDER BY 1, 2;
WITH cte_delete as (DELETE FROM users_table WHERE user_name in ('A', 'D') RETURNING *) WITH cte_delete as (DELETE FROM users_table WHERE user_name in ('A', 'D') RETURNING *)
INSERT INTO users_table SELECT * FROM cte_delete; INSERT INTO users_table SELECT * FROM cte_delete;
-- verify contents are the same -- verify contents are the same
SELECT citus.mitmproxy('conn.allow()');
mitmproxy
-----------
(1 row)
SELECT * FROM users_table ORDER BY 1, 2; SELECT * FROM users_table ORDER BY 1, 2;
user_id | user_name user_id | user_name
---------+----------- ---------+-----------
@ -295,7 +259,7 @@ INSERT INTO users_table SELECT * FROM cte_delete;
ERROR: server closed the connection unexpectedly ERROR: server closed the connection unexpectedly
This probably means the server terminated abnormally This probably means the server terminated abnormally
before or while processing the request. before or while processing the request.
CONTEXT: while executing command on localhost:57640 CONTEXT: while executing command on localhost:9060
-- verify contents are the same -- verify contents are the same
SELECT citus.mitmproxy('conn.allow()'); SELECT citus.mitmproxy('conn.allow()');
mitmproxy mitmproxy
@ -325,7 +289,7 @@ INSERT INTO users_table SELECT * FROM cte_delete;
ERROR: server closed the connection unexpectedly ERROR: server closed the connection unexpectedly
This probably means the server terminated abnormally This probably means the server terminated abnormally
before or while processing the request. before or while processing the request.
CONTEXT: while executing command on localhost:57640 CONTEXT: while executing command on localhost:9060
-- verify contents are the same -- verify contents are the same
SELECT citus.mitmproxy('conn.allow()'); SELECT citus.mitmproxy('conn.allow()');
mitmproxy mitmproxy
@ -397,7 +361,29 @@ SELECT * FROM users_table ORDER BY 1, 2;
5 | E 5 | E
(5 rows) (5 rows)
-- test sequential delete/insert
SELECT citus.mitmproxy('conn.onQuery(query="^DELETE FROM").kill()');
mitmproxy
-----------
(1 row)
BEGIN;
SET LOCAL citus.multi_shard_modify_mode = 'sequential';
WITH cte_delete as (DELETE FROM users_table WHERE user_name in ('A', 'D') RETURNING *)
INSERT INTO users_table SELECT * FROM cte_delete;
ERROR: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
CONTEXT: while executing command on localhost:9060
END;
RESET SEARCH_PATH; RESET SEARCH_PATH;
SELECT citus.mitmproxy('conn.allow()');
mitmproxy
-----------
(1 row)
DROP SCHEMA cte_failure CASCADE; DROP SCHEMA cte_failure CASCADE;
NOTICE: drop cascades to 3 other objects NOTICE: drop cascades to 3 other objects
DETAIL: drop cascades to table cte_failure.users_table DETAIL: drop cascades to table cte_failure.users_table

View File

@ -40,8 +40,7 @@ FROM
WHERE foo.user_id = cte.user_id; WHERE foo.user_id = cte.user_id;
-- kill at the second copy (pull) -- kill at the second copy (pull)
SELECT citus.mitmproxy('conn.allow()'); SELECT citus.mitmproxy('conn.onQuery(query="SELECT user_id FROM cte_failure.events_table_102250").kill()');
SELECT citus.mitmproxy('conn.onQuery(query="SELECT user_id FROM").kill()');
WITH cte AS ( WITH cte AS (
WITH local_cte AS ( WITH local_cte AS (
@ -68,7 +67,6 @@ FROM
WHERE foo.user_id = cte.user_id; WHERE foo.user_id = cte.user_id;
-- kill at the third copy (pull) -- kill at the third copy (pull)
SELECT citus.mitmproxy('conn.allow()');
SELECT citus.mitmproxy('conn.onQuery(query="SELECT DISTINCT users_table.user").kill()'); SELECT citus.mitmproxy('conn.onQuery(query="SELECT DISTINCT users_table.user").kill()');
WITH cte AS ( WITH cte AS (
@ -96,7 +94,6 @@ FROM
WHERE foo.user_id = cte.user_id; WHERE foo.user_id = cte.user_id;
-- cancel at the first copy (push) -- cancel at the first copy (push)
SELECT citus.mitmproxy('conn.allow()');
SELECT citus.mitmproxy('conn.onQuery(query="^COPY").cancel(' || :pid || ')'); SELECT citus.mitmproxy('conn.onQuery(query="^COPY").cancel(' || :pid || ')');
WITH cte AS ( WITH cte AS (
@ -124,7 +121,6 @@ FROM
WHERE foo.user_id = cte.user_id; WHERE foo.user_id = cte.user_id;
-- cancel at the second copy (pull) -- cancel at the second copy (pull)
SELECT citus.mitmproxy('conn.allow()');
SELECT citus.mitmproxy('conn.onQuery(query="SELECT user_id FROM").cancel(' || :pid || ')'); SELECT citus.mitmproxy('conn.onQuery(query="SELECT user_id FROM").cancel(' || :pid || ')');
WITH cte AS ( WITH cte AS (
@ -152,7 +148,6 @@ FROM
WHERE foo.user_id = cte.user_id; WHERE foo.user_id = cte.user_id;
-- cancel at the third copy (pull) -- cancel at the third copy (pull)
SELECT citus.mitmproxy('conn.allow()');
SELECT citus.mitmproxy('conn.onQuery(query="SELECT DISTINCT users_table.user").cancel(' || :pid || ')'); SELECT citus.mitmproxy('conn.onQuery(query="SELECT DISTINCT users_table.user").cancel(' || :pid || ')');
WITH cte AS ( WITH cte AS (
@ -191,7 +186,6 @@ SELECT * FROM users_table ORDER BY 1, 2;
WITH cte_delete as (DELETE FROM users_table WHERE user_name in ('A', 'D') RETURNING *) WITH cte_delete as (DELETE FROM users_table WHERE user_name in ('A', 'D') RETURNING *)
INSERT INTO users_table SELECT * FROM cte_delete; INSERT INTO users_table SELECT * FROM cte_delete;
-- verify contents are the same -- verify contents are the same
SELECT citus.mitmproxy('conn.allow()');
SELECT * FROM users_table ORDER BY 1, 2; SELECT * FROM users_table ORDER BY 1, 2;
-- kill connection during deletion -- kill connection during deletion
@ -230,7 +224,14 @@ INSERT INTO users_table SELECT * FROM cte_delete;
SELECT citus.mitmproxy('conn.allow()'); SELECT citus.mitmproxy('conn.allow()');
SELECT * FROM users_table ORDER BY 1, 2; SELECT * FROM users_table ORDER BY 1, 2;
-- test sequential delete/insert
SELECT citus.mitmproxy('conn.onQuery(query="^DELETE FROM").kill()');
BEGIN;
SET LOCAL citus.multi_shard_modify_mode = 'sequential';
WITH cte_delete as (DELETE FROM users_table WHERE user_name in ('A', 'D') RETURNING *)
INSERT INTO users_table SELECT * FROM cte_delete;
END;
RESET SEARCH_PATH; RESET SEARCH_PATH;
SELECT citus.mitmproxy('conn.allow()');
DROP SCHEMA cte_failure CASCADE; DROP SCHEMA cte_failure CASCADE;