ClickHouse 日志显示未压缩文件的哈希值不匹配
ClickHouse log shows hash of uncompressed files doesn't match
ClickHouse 日志经常打印如下错误信息:
2021.01.07 00:55:24.112567 [ 6418 ] {} <Error> vms.analysis_data (7056dab3-3677-455b-a07a-4d16904479b4):
Code: 40, e.displayText() = DB::Exception: Checksums of parts don't match:
hash of uncompressed files doesn't match (version 20.11.4.13 (official build)).
Data after merge is not byte-identical to data on another replicas. There could be several reasons:
1. Using newer version of compression library after server update.
2. Using another compression method.
3. Non-deterministic compression algorithm (highly unlikely).
4. Non-deterministic merge algorithm due to logical error in code.
5. Data corruption in memory due to bug in code.
6. Data corruption in memory due to hardware issue.
7. Manual modification of source data after server startup.
8. Manual modification of checksums stored in ZooKeeper.
9. Part format related settings like 'enable_mixed_granularity_parts' are different on different replicas.
We will download merged part from replica to force byte-identical result.
我们在生产环境中对所有数据节点使用相同的版本(20.11.4.13)和相同的压缩方法(LZ4),我们不会修改数据文件或存储在Zookeeper中的值。
所以我的问题是:
- 错误是怎么造成的?另外,CickHouse服务器在什么情况下会抛出这些异常?
- 合并部分时副本之间是否有checksum校验机制?
- 我还发现在我们的一个数据节点中,分离文件夹中有很多名为“ignored_20201208_23116_23116_0”的文件夹,这些文件是否是由于所提到的问题导致的损坏数据?
谢谢。
您需要将所有节点升级到 20.11.6.6 尽快。
这些错误的原因是与 AIO 相关的严重错误。
ignored_ -- 不相关。您可以删除它们。
gtranslate: 非活动部分不会立即删除,因为在写入新部分时,不会调用 fsync,即一段时间内,新部分仅在服务器的 RAM 中(OS缓存)。因此,当服务器自发重新启动时,新(合并)的部分可能会丢失或损坏。在这种情况下,ClickHouse 在启动过程中正在检查部件的完整性,如果它检测到问题,它会 returns 将不活动的块添加到活动列表中,然后再次合并它们。在这种情况下,碎片被重命名(添加前缀 broken_)并移动到分离文件夹。如果完整性检查未检测到合并部分存在问题,则将原来的非活动块重命名(添加前缀 ignored_)并移至分离文件夹。
ClickHouse 日志经常打印如下错误信息:
2021.01.07 00:55:24.112567 [ 6418 ] {} <Error> vms.analysis_data (7056dab3-3677-455b-a07a-4d16904479b4):
Code: 40, e.displayText() = DB::Exception: Checksums of parts don't match:
hash of uncompressed files doesn't match (version 20.11.4.13 (official build)).
Data after merge is not byte-identical to data on another replicas. There could be several reasons:
1. Using newer version of compression library after server update.
2. Using another compression method.
3. Non-deterministic compression algorithm (highly unlikely).
4. Non-deterministic merge algorithm due to logical error in code.
5. Data corruption in memory due to bug in code.
6. Data corruption in memory due to hardware issue.
7. Manual modification of source data after server startup.
8. Manual modification of checksums stored in ZooKeeper.
9. Part format related settings like 'enable_mixed_granularity_parts' are different on different replicas.
We will download merged part from replica to force byte-identical result.
我们在生产环境中对所有数据节点使用相同的版本(20.11.4.13)和相同的压缩方法(LZ4),我们不会修改数据文件或存储在Zookeeper中的值。
所以我的问题是:
- 错误是怎么造成的?另外,CickHouse服务器在什么情况下会抛出这些异常?
- 合并部分时副本之间是否有checksum校验机制?
- 我还发现在我们的一个数据节点中,分离文件夹中有很多名为“ignored_20201208_23116_23116_0”的文件夹,这些文件是否是由于所提到的问题导致的损坏数据?
谢谢。
您需要将所有节点升级到 20.11.6.6 尽快。
这些错误的原因是与 AIO 相关的严重错误。
ignored_ -- 不相关。您可以删除它们。
gtranslate: 非活动部分不会立即删除,因为在写入新部分时,不会调用 fsync,即一段时间内,新部分仅在服务器的 RAM 中(OS缓存)。因此,当服务器自发重新启动时,新(合并)的部分可能会丢失或损坏。在这种情况下,ClickHouse 在启动过程中正在检查部件的完整性,如果它检测到问题,它会 returns 将不活动的块添加到活动列表中,然后再次合并它们。在这种情况下,碎片被重命名(添加前缀 broken_)并移动到分离文件夹。如果完整性检查未检测到合并部分存在问题,则将原来的非活动块重命名(添加前缀 ignored_)并移至分离文件夹。