ClickHouse / ClickHouse

ClickHouse® is a real-time analytics DBMS
https://clickhouse.com
Apache License 2.0
37.59k stars 6.9k forks source link

Read data replica consistency #70586

Open easymanlo opened 1 month ago

easymanlo commented 1 month ago

Company or project name

No response

Question

The ClickHouse version is 21.9.3.30. Currently, when writing data, the write operation succeeds, but the data read is incomplete. We can only add the insert_quorum=2 parameter to wait until all replicas finish writing before reading the complete data. This approach is not ideal for our scenario. In the latest version of ClickHouse, how is this problem resolved? Specifically, how does the latest version ensure that after data is written, it can read complete data instead of reading from replicas that haven't finished syncing?

den-crane commented 1 month ago

Do you read from Replicated table or from Distributed

Have you try select_sequential_consistency https://clickhouse.com/docs/en/integrations/postgresql/postgres-vs-clickhouse#sequential-consistency https://clickhouse.com/docs/en/operations/settings/settings#select_sequential_consistency

easymanlo commented 4 weeks ago

Thank you for your response. I will look into the two solutions you provided to see if they can address our issues. Currently, we are using the ReplicatedMergeTree table engine in a storage-compute integrated setup.