While updating a partition, a concurrent DROP TABLE (e.g., partition) or CREATE PARTITION gets into distributed deadlock
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
To easily repro:
cat /tmp/f.sql
pgbench -f /tmp/f.sql -c 64 -j 8 -T 1200 -P 1 postgres
```SQL
update traffic_flows_day_9_20210712 set src_id = 1;
```
-- other session
```SQL
drop table traffic_flows_day_6_20210712; ERROR: canceling the transaction since it was involved in a distributed deadlock
CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name)"
PL/pgSQL function citus_drop_trigger() line 16 at PERFORM
Time: 952.391 ms
```
-- or
```SQL
CREATE TABLE traffic_flows_day_6_20210712 PARTITION OF traffic_flows_day_6 FOR VALUES FROM ('6', '2021-07-12') TO ('6', '2021-07-13');
ERROR: canceling the transaction since it was involved in a distributed deadlock
Time: 1356.825 ms (00:01.357)
```
It might not happen 100% accuracy, but like ~50% on my local machine
Contributor guide
Assessment
This issue has not been assessed yet.