citusdata / citusdata/citus

create_distributed_table may create shards on inactive nodes

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

Description

create_distributed_table may create shards on inactive node, if a worker node is disabled from a parallel session. It occurs if the first session has already created another distributed table.

Reproduce steps :

Step 1 : `create table test_table1(id int, value_1 int);` (from Session 1)
Step 2 : `select create_distributed_table('test_table1', 'id');` (from Session 1)
Step 3 : `select master_disable_node('worker_node_name', worker_port);` (from Session 2)
Step 4 : `create table test_table2(id int, value_1 int);` (from Session 1)
Step 5 : `select create_distributed_table('test_table2', 'id');` (from Session 1)

You can check the disabled worker node to see created shards for test_table2. If you run select query on Session 1 it errors out with `failed to assign XX task(s) to worker nodes`

It may be related to #2025

Contributor guide

Open the contributing guide

Research direction

Start with the five-step reproduction using two PostgreSQL sessions, focusing on create_distributed_table after master_disable_node. Review related issue #2025 for context. Done means shards are not created on the disabled worker and the resulting distributed table can be queried without the task-assignment error.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, postgresql, sql
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.