Altinity / Altinity/clickhouse-operator

Restore replicated engine database

Open
#1,664 0 comments 1 reaction 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

follow up https://github.com/Altinity/clickhouse-operator/issues/969

Current error

Code: 253, Message: Replica chi-***-clickhouse-cluster-s0r2 of shard shard0 of replicated database at /clickhouse/*** already exists. 
*** 
*** for SQL:  CREATE DATABASE IF NOT EXISTS ****  ENGINE=Replicated('/clickhouse/****', '{shard}', '{replica}') ;

--

how i got around this error manually

SYSTEM DROP DATABASE REPLICA 'chi-***-clickhouse-cluster-s0r2' FROM SHARD 'shard0' FROM ZKPATH '/clickhouse/****';    

After this, the operator was able to restore the database

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 with the linked follow-up issue #969 and the replicated-database CREATE DATABASE statement shown here. Trace how the operator handles the existing replica and compare it with the manual SYSTEM DROP DATABASE REPLICA workaround; done means the operator can restore the database without that manual cleanup.

Written by the indexing model from the issue text.

Assessment

Tech stack
clickhouse, kubernetes
Domain
databases, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.