Version logic issue #243
VladimirDVV
started this conversation in
General
Replies: 1 comment
|
For now added |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello! I've encountered an issue with the _version column logic when switching replication modes and clearing the replicator's state.
I started the replication with skip_initial_replication: false to allow the tool to create the ClickHouse table structure and perform an initial sync.
During this process, the _version column reached a certain value (e.g., 100).
I stopped the process to manually add indexes to the ClickHouse table.
I cleared the contents of the binlog_replicator.data_dir folder to reset the internal state.
I changed the configuration to skip_initial_replication: true and restarted the replicator.
When the replication resumed in skip_initial mode, the new data coming from the MySQL binlog had _version values starting from 1.
Because I am using ReplacingMergeTree, ClickHouse considers the old records (with _version = 100) to be "newer" than the current real-time data (where _version restarted at 1). As a result, updates in ClickHouse are not being applied correctly because the "older" high-version records persist.
All reactions