Fix check-full failures

This commit fixes failures happen during check-full. The change does make
clean seperation of executor types in certain places to keep the outputs
stable.
pull/498/head
Onder Kalaci 2016-05-05 11:49:58 +03:00
parent eab60e20de
commit d7fd56df89
5 changed files with 124 additions and 27 deletions

View File

@ -2,6 +2,7 @@
-- MULTI_EXPLAIN -- MULTI_EXPLAIN
-- --
\a\t \a\t
SET citus.task_executor_type TO 'real-time';
SET citus.explain_distributed_queries TO on; SET citus.explain_distributed_queries TO on;
-- Test Text format -- Test Text format
EXPLAIN (COSTS FALSE, FORMAT TEXT) EXPLAIN (COSTS FALSE, FORMAT TEXT)

View File

@ -2,6 +2,7 @@
-- MULTI_EXPLAIN -- MULTI_EXPLAIN
-- --
\a\t \a\t
SET citus.task_executor_type TO 'real-time';
SET citus.explain_distributed_queries TO on; SET citus.explain_distributed_queries TO on;
-- Test Text format -- Test Text format
EXPLAIN (COSTS FALSE, FORMAT TEXT) EXPLAIN (COSTS FALSE, FORMAT TEXT)

View File

@ -31,6 +31,14 @@ SELECT master_create_worker_shards('orders_hash_partitioned', 4, 1);
SET client_min_messages TO DEBUG2; SET client_min_messages TO DEBUG2;
-- Check that we can prune shards for simple cases, boolean expressions and -- Check that we can prune shards for simple cases, boolean expressions and
-- immutable functions. -- immutable functions.
-- Since router plans are not triggered for task-tracker executor type,
-- we need to run the tests that triggers router planning seperately for
-- both executors. Otherwise, check-full fails on the task-tracker.
-- Later, we need to switch back to the actual task executor
-- to contuinue with correct executor type for check-full.
SELECT quote_literal(current_setting('citus.task_executor_type')) AS actual_task_executor
\gset
SET citus.task_executor_type TO 'real-time';
SELECT count(*) FROM orders_hash_partitioned; SELECT count(*) FROM orders_hash_partitioned;
count count
------- -------
@ -81,6 +89,92 @@ DEBUG: Plan is router executable
0 0
(1 row) (1 row)
SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1 AND o_clerk = 'aaa';
DEBUG: Creating router plan
DEBUG: predicate pruning for shardId 102034
DEBUG: predicate pruning for shardId 102035
DEBUG: predicate pruning for shardId 102036
DEBUG: Plan is router executable
count
-------
0
(1 row)
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = abs(-1);
DEBUG: Creating router plan
DEBUG: predicate pruning for shardId 102034
DEBUG: predicate pruning for shardId 102035
DEBUG: predicate pruning for shardId 102036
DEBUG: Plan is router executable
count
-------
0
(1 row)
SET citus.task_executor_type TO 'task-tracker';
SELECT count(*) FROM orders_hash_partitioned;
count
-------
0
(1 row)
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 1;
DEBUG: predicate pruning for shardId 102034
DEBUG: predicate pruning for shardId 102035
DEBUG: predicate pruning for shardId 102036
count
-------
0
(1 row)
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 2;
DEBUG: predicate pruning for shardId 102033
DEBUG: predicate pruning for shardId 102034
DEBUG: predicate pruning for shardId 102035
count
-------
0
(1 row)
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 3;
DEBUG: predicate pruning for shardId 102033
DEBUG: predicate pruning for shardId 102035
DEBUG: predicate pruning for shardId 102036
count
-------
0
(1 row)
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 4;
DEBUG: predicate pruning for shardId 102033
DEBUG: predicate pruning for shardId 102035
DEBUG: predicate pruning for shardId 102036
count
-------
0
(1 row)
SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1 AND o_clerk = 'aaa';
DEBUG: predicate pruning for shardId 102034
DEBUG: predicate pruning for shardId 102035
DEBUG: predicate pruning for shardId 102036
count
-------
0
(1 row)
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = abs(-1);
DEBUG: predicate pruning for shardId 102034
DEBUG: predicate pruning for shardId 102035
DEBUG: predicate pruning for shardId 102036
count
-------
0
(1 row)
SET citus.task_executor_type TO :actual_task_executor;
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey is NULL; SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey is NULL;
DEBUG: predicate pruning for shardId 102033 DEBUG: predicate pruning for shardId 102033
DEBUG: predicate pruning for shardId 102034 DEBUG: predicate pruning for shardId 102034
@ -118,18 +212,6 @@ SELECT count(*) FROM orders_hash_partitioned
0 0
(1 row) (1 row)
SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1 AND o_clerk = 'aaa';
DEBUG: Creating router plan
DEBUG: predicate pruning for shardId 102034
DEBUG: predicate pruning for shardId 102035
DEBUG: predicate pruning for shardId 102036
DEBUG: Plan is router executable
count
-------
0
(1 row)
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1 OR (o_orderkey = 3 AND o_clerk = 'aaa'); WHERE o_orderkey = 1 OR (o_orderkey = 3 AND o_clerk = 'aaa');
DEBUG: predicate pruning for shardId 102035 DEBUG: predicate pruning for shardId 102035
@ -158,17 +240,6 @@ DEBUG: predicate pruning for shardId 102036
0 0
(1 row) (1 row)
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = abs(-1);
DEBUG: Creating router plan
DEBUG: predicate pruning for shardId 102034
DEBUG: predicate pruning for shardId 102035
DEBUG: predicate pruning for shardId 102036
DEBUG: Plan is router executable
count
-------
0
(1 row)
-- Check that we don't support pruning for ANY (array expression) and give -- Check that we don't support pruning for ANY (array expression) and give
-- a notice message when used with the partition column -- a notice message when used with the partition column
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned

View File

@ -4,6 +4,7 @@
\a\t \a\t
SET citus.task_executor_type TO 'real-time';
SET citus.explain_distributed_queries TO on; SET citus.explain_distributed_queries TO on;
-- Test Text format -- Test Text format

View File

@ -27,11 +27,38 @@ SET client_min_messages TO DEBUG2;
-- Check that we can prune shards for simple cases, boolean expressions and -- Check that we can prune shards for simple cases, boolean expressions and
-- immutable functions. -- immutable functions.
-- Since router plans are not triggered for task-tracker executor type,
-- we need to run the tests that triggers router planning seperately for
-- both executors. Otherwise, check-full fails on the task-tracker.
-- Later, we need to switch back to the actual task executor
-- to contuinue with correct executor type for check-full.
SELECT quote_literal(current_setting('citus.task_executor_type')) AS actual_task_executor
\gset
SET citus.task_executor_type TO 'real-time';
SELECT count(*) FROM orders_hash_partitioned; SELECT count(*) FROM orders_hash_partitioned;
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 1; SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 1;
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 2; SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 2;
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 3; SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 3;
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 4; SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 4;
SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1 AND o_clerk = 'aaa';
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = abs(-1);
SET citus.task_executor_type TO 'task-tracker';
SELECT count(*) FROM orders_hash_partitioned;
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 1;
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 2;
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 3;
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = 4;
SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1 AND o_clerk = 'aaa';
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = abs(-1);
SET citus.task_executor_type TO :actual_task_executor;
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey is NULL; SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey is NULL;
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey is not NULL; SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey is not NULL;
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey > 2; SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey > 2;
@ -40,8 +67,6 @@ SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1 OR o_orderkey = 2; WHERE o_orderkey = 1 OR o_orderkey = 2;
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1 OR o_clerk = 'aaa'; WHERE o_orderkey = 1 OR o_clerk = 'aaa';
SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1 AND o_clerk = 'aaa';
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
WHERE o_orderkey = 1 OR (o_orderkey = 3 AND o_clerk = 'aaa'); WHERE o_orderkey = 1 OR (o_orderkey = 3 AND o_clerk = 'aaa');
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned
@ -49,8 +74,6 @@ SELECT count(*) FROM orders_hash_partitioned
SELECT count(*) FROM SELECT count(*) FROM
(SELECT o_orderkey FROM orders_hash_partitioned WHERE o_orderkey = 1) AS orderkeys; (SELECT o_orderkey FROM orders_hash_partitioned WHERE o_orderkey = 1) AS orderkeys;
SELECT count(*) FROM orders_hash_partitioned WHERE o_orderkey = abs(-1);
-- Check that we don't support pruning for ANY (array expression) and give -- Check that we don't support pruning for ANY (array expression) and give
-- a notice message when used with the partition column -- a notice message when used with the partition column
SELECT count(*) FROM orders_hash_partitioned SELECT count(*) FROM orders_hash_partitioned