ClickHouse / ClickHouse/ClickHouse

Metadata on replica is not up to date with common metadata in Zookeeper

Open
#42,199 1 comment 0 reactions 0 assignees View on GitHub
comp-replication external question
Dominant language
C++
Stars
49.9k
Forks
9k
Avg merge
21h 32m
Merged PRs (30d)
515

Description

hi, I set up a clickhouse cluster (2 nodes) by using this [docker-compose](https://gist.github.com/suikammd/310572c1716bb07ba7a90f97f7cd9538).
But When I do docker-compose up, I got this error
```
clickhouse01 | Code: 517. DB::Exception: Received from 127.0.0.1:9000. DB::Exception: Metadata on replica is not up to date with common metadata in Zookeeper. It means that this replica still not applied some of previous alters. Probably too many alters executing concurrently (highly not recommended). You can retry this error. (CANNOT_ASSIGN_ALTER)
clickhouse01 | (query: ALTER TABLE logs ADD COLUMN IF NOT EXISTS `line` String)

```

I mount a init sql below to both nodes and try to init on both nodes instead by doing `ALTER TABLE ADD COLUMN on cluster '{cluster}'`, since there may be ddls piled up in zookeeper.
```
CREATE TABLE IF NOT EXISTS logs on cluster '{cluster}' (
`ts` Int64 CODEC(DoubleDelta, LZ4),
`ts_datetime` DateTime DEFAULT toDateTime(fromUnixTimestamp64Nano(ts, 'UTC'), 'UTC') CODEC(DoubleDelta, LZ4),
)

ALTER TABLE logs ADD COLUMN IF NOT EXISTS `line` String
```

To avoid ddls piled up in zookeeper when I try to init clickhouse, is there a better way to solve this problem?

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.