Altinity / Altinity/clickhouse-operator

REPLICA_ALREADY_EXISTS due to hardcoded UUID in the replicas

Open
#1,932 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.6k
Forks
574
Avg merge
8d 6h
Merged PRs (30d)
6

Description

While using

ENGINE = ReplicatedAggregatingMergeTree('/clickhouse/tables/{uuid}/{shard}', '{replica}')

New replica gets hardcoded uuid once its recreated as in this commit https://github.com/Altinity/clickhouse-operator/commit/ac45f5e0e0308452c7ec301d79146b3c7e5fa879

Shouldn't this be configurable to avoid such situation.

ATTACH TABLE _ UUID '<uuid>'
(
...
)
ENGINE = ReplicatedAggregatingMergeTree('/clickhouse/tables/{uuid}/{shard}', '{replica}')

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading commit ac45f5e0e0308452c7ec301d79146b3c7e5fa879 and the replica creation path it changed. Trace how the ATTACH TABLE UUID and ReplicatedAggregatingMergeTree path are generated, then define and test a configurable UUID behavior that prevents REPLICA_ALREADY_EXISTS after recreation.

Written by the indexing model from the issue text.

Assessment

Tech stack
clickhouse, go, kubernetes
Domain
databases, infrastructure
Issue type
Feature
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.