(multi_repartition_join_planning.sql) With citus_set_coordinator_host, and citus.shard_replication_factor = 2, repartition join fails with ERROR: Query could not find the intermediate result file "repartition_1_1_2"...
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
Repro Steps (derived from multi_repartition_join_planning.sql):
Create a citus cluster using
`citus_dev make test --size=2`
Note that citus_dev adds the coordinator to metadata using` SELECT * from citus_set_coordinator_host('localhost', {port});`
Run the following commands:
SET citus.shard_replication_factor to 2;
-- make sure coordinator is always in metadata.
SET citus.next_shard_id TO 360000;
CREATE TABLE lineitem (
l_orderkey bigint not null,
l_partkey integer not null,
l_suppkey integer not null,
l_linenumber integer not null,
l_quantity decimal(15, 2) not null,
l_extendedprice decimal(15, 2) not null,
l_discount decimal(15, 2) not null,
l_tax decimal(15, 2) not null,
l_returnflag char(1) not null,
l_linestatus char(1) not null,
l_shipdate date not null,
l_commitdate date not null,
l_receiptdate date not null,
l_shipinstruct char(25) not null,
l_shipmode char(10) not null,
l_comment varchar(44) not null,
PRIMARY KEY(l_orderkey, l_linenumber) );
SELECT create_distributed_table('lineitem', 'l_orderkey', 'hash', shard_count := 2);
-- CREATE INDEX lineitem_time_index ON lineitem (l_shipdate);
CREATE TABLE orders (
o_orderkey bigint not null,
o_custkey integer not null,
o_orderstatus char(1) not null,
o_totalprice decimal(15,2) not null,
o_orderdate date not null,
o_orderpriority char(15) not null,
o_clerk char(15) not null,
o_shippriority integer not null,
o_comment varchar(79) not null,
PRIMARY KEY(o_orderkey) );
SELECT create_distributed_table('orders', 'o_orderkey', 'hash', colocate_with := 'lineitem');
CREATE TABLE customer_append (
c_custkey integer not null,
c_name varchar(25) not null,
c_address varchar(40) not null,
c_nationkey integer not null,
c_phone char(15) not null,
c_acctbal decimal(15,2) not null,
c_mktsegment char(10) not null,
c_comment varchar(117) not null);
SELECT create_distributed_table('customer_append', 'c_custkey', 'append');
SELECT master_create_empty_shard('customer_append');
CREATE TABLE part_append (
p_partkey integer not null,
p_name varchar(55) not null,
p_mfgr char(25) not null,
p_brand char(10) not null,
p_type varchar(25) not null,
p_size integer not null,
p_container char(10) not null,
p_retailprice decimal(15,2) not null,
p_comment varchar(23) not null);
SELECT create_distributed_table('part_append', 'p_partkey', 'append');
SELECT master_create_empty_shard('part_append');
SET citus.next_shard_id TO 690000;
SET citus.enable_unique_job_ids TO off;
SET citus.enable_repartition_joins to ON;
BEGIN;
SET client_min_messages TO DEBUG;
SELECT
l_partkey, o_orderkey, count(*)
FROM
lineitem, part_append, orders, customer_append
WHERE
l_orderkey = o_orderkey AND
l_partkey = p_partkey AND
c_custkey = o_custkey AND
(l_quantity > 5.0 OR l_extendedprice > 1200.0) AND
p_size > 8 AND o_totalprice > 10.0 AND
c_acctbal < 5000.0 AND l_partkey < 1000
GROUP BY
l_partkey, o_orderkey
ORDER BY
l_partkey, o_orderkey;
..............................
ERROR: Query could not find the intermediate result file "repartition_1_1_2", it was mostly likely deleted due to an error in a parallel process within the same distributed transaction
current transaction is aborted, commands ignored until end of transaction block
ROLLBACK
The same scneario succeeds if you remove the coordinator at the beginning:
SELECT master_remove_node('localhost', 9700);
Contributor guide
Assessment
This issue has not been assessed yet.