citusdata / citusdata/citus

In a transaction block, creating a distributed table whose name exceeds 64 characters may create a distributed deadlock

Open
#1,664 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

The following code block works as expected in Citus 6.2-4:

BEGIN;

CREATE TABLE tmp_a191e16d9d53aeca7616674831a561af_client_session_opened (
foo text NOT NULL
);
SELECT create_distributed_table('tmp_a191e16d9d53aeca7616674831a561af_client_session_opened', 'foo');

In Citus 7.0-15, the same code block results in a transaction that hangs. The distributed deadlock detection code ultimately aborts the transaction. I see the following error on the coordinator node:

ERROR:  

CONTEXT: while executing command on citus_worker_1:5432

PostgreSQL truncates table names that exceed 64 characters. Citus does the same for shard names. However, we didn't change any logic in Citus 7 related to name truncation (or adding a hash into the shard name).

The issue here could be related to how Citus manages transactions and connections. The error message above is a symptom and we should look to identify its root cause.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.