Clickhouse: No data in replicated table

Created on 2 Sep 2020  路  8Comments  路  Source: ClickHouse/ClickHouse

I have two replicas. Data are inserted into table in replica A. Table counterpart in replica B is empty though. Data are not replicated between replicas. I tried recreating table in replica B but it did not trigger the sync.

Replication for other tables is working just fine.

What can I do to debug the issue? show create table gives same result for both replicas.

ClickHouse version 20.6

invalid question question-answered

All 8 comments

check (at both nodes) : select * from system.replication_queue

wrong ZK path? different shards?

I don't have multiple shards.

replication queue does not contain any records for the target table

path is the same (reported by show create table)

馃

Show grep tablename clickhouseserver.log

I tried grepping cat /var/log/clickhouse-server/clickhouse-server.log in both replicas but for this particular table contains no logs (it does have some warnings for larger tables though).

It could be anything. How did you copy/pasted / attached zk path when you created a table?

For example these two strings are different.
Latin: /ccccc/
小yrrylic: /褋褋褋褋褋/

Check zookeeper select * from system.zookeeper where path = '/..zk_path/replicas
Check select * from system.replicas where table = ...

select * from system.zookeeper where path = '/..zk_path/replicas
Gives result on both replicas.

But on the B, there's replicas last added replica: A (version: 1)
For fully replicated tables it's replicas last added replica: B (version: 4)

system.replicas says the total_replicas is 1. Seems like those tables are disconnected on both replicas. Is there a way to get in in sync somehow?

How did you copy/pasted / attached zk path when you created a table?

I did it a long time ago but It was simple CREATE TABLE ON CLUSTER I believe

Check at both servers that zhash is identical


select replica_name, total_replicas, active_replicas, zookeeper_path, 
           cityHash64(zookeeper_path) zhash, hex(zookeeper_path) 
from system.replicas
where table = '....'

Zookeeper paths differ in a small typo :/ Thank you very much for helping me debug this. I have setup a new monitoring query to catch this in the future.

Was this page helpful?
0 / 5 - 0 ratings