Don't make extra checksums checks when commit a part. [#CLICKHOUSE-2]

This patch is very crucial in case of many replicas.
This commit is contained in:
Vitaliy Lyudvichenko 2018-05-18 01:57:31 +03:00
parent 445f8800c3
commit 4b093e3e0a

View File

@ -923,6 +923,14 @@ void StorageReplicatedMergeTree::checkPartChecksumsAndAddCommitOps(const zkutil:
if (replica == replica_name)
has_been_alredy_added = true;
/// If we verify checksums in "sequential manner" (i.e. recheck absence of checksums on other replicas when commit)
/// then it is enough to verify checksums on at least one replica since checksums on other replicas must be the same.
if (absent_replicas_paths)
{
absent_replicas_paths->clear();
break;
}
}
if (!has_been_alredy_added)