citusdata / citusdata/citus

Cannot distribute a partition-to-be table if it has data and a long name

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

Description

### Steps to reproduce:
```SQL
CREATE TABLE parent (
event_id serial NOT NULL,
event_time timestamptz NOT NULL DEFAULT now())
PARTITION BY RANGE (event_time);

SELECT create_distributed_table('parent', 'event_id');

CREATE TABLE non_distributed_child_with_very_very_very_loooooooong_table_name (
event_id int NOT NULL,
event_time timestamptz NOT NULL DEFAULT now());

INSERT INTO non_distributed_child_with_very_very_very_loooooooong_table_name
SELECT i, '2021-06-15' FROM generate_series(0, 10)i;

ALTER TABLE parent ATTACH PARTITION non_distributed_child_with_very_very_very_loooooooong_table_name
FOR VALUES FROM ('2021-06-01') TO ('2021-07-30');
```
### The error hit is:
```
ERROR: cannot distribute "non_distributed_child_with_very_very_very_loooooooong_table_nam" in sequential mode
because it is not empty
HINT: If you have manually set citus.multi_shard_modify_mode to 'sequential', try with 'parallel' option.
If that is not the case, try distributing local tables when they are empty.
```

@onderkalaci has some further comments on this https://github.com/citusdata/citus/pull/5191#pullrequestreview-742328129
> I guess it is related to #3895 where create_distributed_table internally forces parallel execution. Still, with #3841, we should probably be fine to remove forcing to use parallelization and/or the sequential execution checks.

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.