From 2ab0e63b305e6d4e14d0e86d9c4b19cc5316a5fd Mon Sep 17 00:00:00 2001 From: Onder Kalaci Date: Mon, 20 Aug 2018 20:47:14 +0300 Subject: [PATCH] Fix flaky test --- src/test/regress/expected/dml_recursive.out | 43 +++++++++++++++++++-- src/test/regress/sql/dml_recursive.sql | 1 + 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/src/test/regress/expected/dml_recursive.out b/src/test/regress/expected/dml_recursive.out index 488e353ed..5b1a09dc6 100644 --- a/src/test/regress/expected/dml_recursive.out +++ b/src/test/regress/expected/dml_recursive.out @@ -295,6 +295,7 @@ DEBUG: common table expressions are not supported in distributed modifications DEBUG: generating subplan 20_1 for CTE cte_1: WITH cte_2 AS (SELECT second_distributed_table.tenant_id AS cte2_id FROM recursive_dml_queries.second_distributed_table WHERE (second_distributed_table.dept OPERATOR(pg_catalog.>=) 2)) UPDATE recursive_dml_queries.distributed_table SET dept = 10 RETURNING tenant_id, dept, info DEBUG: common table expressions are not supported in distributed modifications DEBUG: Plan 20 query after replacing subqueries and CTEs: UPDATE recursive_dml_queries.distributed_table SET dept = 5 FROM (SELECT intermediate_result.tenant_id, intermediate_result.dept, intermediate_result.info FROM read_intermediate_result('20_1'::text, 'binary'::citus_copy_format) intermediate_result(tenant_id text, dept integer, info jsonb)) cte_1 WHERE (distributed_table.tenant_id OPERATOR(pg_catalog.<) cte_1.tenant_id) +SET citus.explain_all_tasks TO ON; EXPLAIN (COSTS FALSE) WITH cte_1 AS ( WITH cte_2 AS ( SELECT tenant_id as cte2_id @@ -320,13 +321,25 @@ DEBUG: Plan 22 query after replacing subqueries and CTEs: UPDATE recursive_dml_ -> Distributed Subplan 22_1 -> Custom Scan (Citus Router) Task Count: 4 - Tasks Shown: One of 4 + Tasks Shown: All -> Task Node: host=localhost port=57638 dbname=regression -> Update on distributed_table_2370000 distributed_table -> Seq Scan on distributed_table_2370000 distributed_table + -> Task + Node: host=localhost port=57637 dbname=regression + -> Update on distributed_table_2370001 distributed_table + -> Seq Scan on distributed_table_2370001 distributed_table + -> Task + Node: host=localhost port=57638 dbname=regression + -> Update on distributed_table_2370002 distributed_table + -> Seq Scan on distributed_table_2370002 distributed_table + -> Task + Node: host=localhost port=57637 dbname=regression + -> Update on distributed_table_2370003 distributed_table + -> Seq Scan on distributed_table_2370003 distributed_table Task Count: 4 - Tasks Shown: One of 4 + Tasks Shown: All -> Task Node: host=localhost port=57638 dbname=regression -> Update on distributed_table_2370000 distributed_table @@ -335,7 +348,31 @@ DEBUG: Plan 22 query after replacing subqueries and CTEs: UPDATE recursive_dml_ -> Function Scan on read_intermediate_result intermediate_result -> Materialize -> Seq Scan on distributed_table_2370000 distributed_table -(19 rows) + -> Task + Node: host=localhost port=57637 dbname=regression + -> Update on distributed_table_2370001 distributed_table + -> Nested Loop + Join Filter: (distributed_table.tenant_id < intermediate_result.tenant_id) + -> Function Scan on read_intermediate_result intermediate_result + -> Materialize + -> Seq Scan on distributed_table_2370001 distributed_table + -> Task + Node: host=localhost port=57638 dbname=regression + -> Update on distributed_table_2370002 distributed_table + -> Nested Loop + Join Filter: (distributed_table.tenant_id < intermediate_result.tenant_id) + -> Function Scan on read_intermediate_result intermediate_result + -> Materialize + -> Seq Scan on distributed_table_2370002 distributed_table + -> Task + Node: host=localhost port=57637 dbname=regression + -> Update on distributed_table_2370003 distributed_table + -> Nested Loop + Join Filter: (distributed_table.tenant_id < intermediate_result.tenant_id) + -> Function Scan on read_intermediate_result intermediate_result + -> Materialize + -> Seq Scan on distributed_table_2370003 distributed_table +(55 rows) -- we don't support updating local table with a join with -- distributed tables diff --git a/src/test/regress/sql/dml_recursive.sql b/src/test/regress/sql/dml_recursive.sql index f44195a84..678aff0f2 100644 --- a/src/test/regress/sql/dml_recursive.sql +++ b/src/test/regress/sql/dml_recursive.sql @@ -234,6 +234,7 @@ SET dept = 5 FROM cte_1 WHERE distributed_table.tenant_id < cte_1.tenant_id; +SET citus.explain_all_tasks TO ON; EXPLAIN (COSTS FALSE) WITH cte_1 AS ( WITH cte_2 AS ( SELECT tenant_id as cte2_id