-
Notifications
You must be signed in to change notification settings - Fork 172
Description
I am trying to use ReplicatedMergeTree engine for Postgres to ClickHouse sync but I got following error during mirror setup.
failed to sync records: QRepSync Error: code: 32, message: Attempt to read after eof: while receiving packet from 172.xx.xx.xx:9000, local address: 172.xx.xx.xx:47276: Insertion status: Wrote 0 blocks and 0 rows on shard 0 replica 1, 172.xx.xx.xx:9000 (average 2 ms per block) Wrote 1 blocks and 16398 rows on shard 0 replica 0, 172.xx.xx.xx:9000 (average 0 ms per block)
--
On checking the table in ClickHouse, it is creating.
CREATE TABLE mydb.anjul_test3_log
(
account_id Int64,
org_id Int64,
filename String,
uploaded_at DateTime64(6),
total_rows Int32,
processed_rows Int32,
total_added Int32,
source String,
_peerdb_synced_at DateTime64(9) DEFAULT now64(),
_peerdb_is_deleted UInt8,
_peerdb_version UInt64
)
ENGINE = Distributed('mycluster', 'mydb', 'anjul_test3_log_shard')
and
CREATE TABLE mydb.anjul_test3_log_shard
(
account_id Int64,
org_id Int64,
filename String,
uploaded_at DateTime64(6),
total_rows Int32,
processed_rows Int32,
total_added Int32,
source String,
_peerdb_synced_at DateTime64(9) DEFAULT now64(),
_peerdb_is_deleted UInt8,
_peerdb_version UInt64
)
ENGINE = ReplicatedReplacingMergeTree('/clickhouse/tables/{uuid}/{shard}/mydb/%sanjul_test3_log', '{replica}', _peerdb_version)
PRIMARY KEY (account_id, org_id, filename, uploaded_at, total_rows, processed_rows, total_added, source)
ORDER BY (account_id, org_id, filename, uploaded_at, total_rows, processed_rows, total_added, source)
SETTINGS index_granularity = 8192
I think the ENGINE rendering is wrong. There shouldn't be %s in ENGINE = ReplicatedReplacingMergeTree('/clickhouse/tables/{uuid}/{shard}/mydb/%sanjul_test3_log', '{replica}', _peerdb_version)