ClickHouse / ClickHouse/ClickHouse
distributed_ddl/ReplicatedMergeTree ALTER inconsistency
- Dominant language
- C++
- Stars
- 49.9k
- Forks
- 9k
- Avg merge
- 21h 32m
- Merged PRs (30d)
- 515
Description
### Company or project name
Aliexpress, VK
### Describe the unexpected behaviour
ALTER TABLE atomicdb.replicated_table ON cluster anycluster ADD column anycolumn anytype;
SELECT exception_text FROM system.distributed_ddl_queue where query='...';
```
┌─exception_text───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Code: 15. DB::Exception: Cannot add column `anycolumn`: column with this name already exists. (DUPLICATE_COLUMN) (version 24.6.2.17 (official build)) │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```
### How to reproduce
CREATE TABLE ... Engine=ReplicatedMergeTree(...);
do some "ON CLUSTER ADD COLUMN" alters
### Expected behavior
Respect replicated tables parameters, or remote_servers configuration, for Engine=ReplicatedMergeTree tables.
ON CLUSTER should add column to 1 replica per shard, then report success or wait for replication delay.
### Error message and/or stacktrace
_No response_
### Additional context
ALTER can be executed with "IF NOT EXISTS" modifier, but what about ON CLUSTER column materialization? should it be executed replication factor times?
plz implement a fix or a setting controls this behavior.
Contributor guide
Assessment
This issue has not been assessed yet.