ClickHouse 失败并出现错误 "DirectoryMonitor: Checksum of extra info doesn't match: corrupted data"
ClickHouse failed with the error "DirectoryMonitor: Checksum of extra info doesn't match: corrupted data"
我的二进制文件在数据中带有曲线(我的错)。 ClickHouse 无法将其插入 table 并停止处理其他数据。我刚刚打开二进制文件进行编辑并修复了错误的字段。在那之后,ClickHouse 拿走了文件并给出了关于无效校验和的错误。
default.affiliate_program.DirectoryMonitor: Code: 40, e.displayText() =
DB::Exception: Checksum of extra info doesn't match: corrupted data. Reference: cb322c17e14d6816abfcdc16842e7bdd. Actual: f4afe41e77b9a92bfa4048648a3aebbb.,
之后,ClickHouse将文件转移到损坏的文件夹中并继续。
是否可以更改校验和或任何其他用于处理我重写的文件的内容?
https://github.com/ClickHouse/ClickHouse/issues/16005
无法为分布式 table 更改 .bin 文件。它有 built-in 校验和,因此需要重新计算它,但这很麻烦。
但还有另一种方式。可以手动选择和插入未损坏的 .bin 文件 select * from file('/path/to/file.bin', 'Distributed')
我只是扩展了@Denny Crane 的原始问题和答案。
由于配置错误,我得到了类似的错误default-profile - it was marked as readonly。结果,随后向分布式 table 插入数据会导致如下错误:
database.table.DirectoryMonitor: Code: 164, e.displayText() =
DB::Exception: Received from **:9000.
DB::Exception: default: Cannot execute query in readonly mode. Stack trace:
0. Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x10519be0 in /usr/bin/clickhouse
1. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x8f5072d in /usr/bin/clickhouse
..
插入到分布式时table:
.. the data block is just written to the
local file system. .. You should check whether data is sent
successfully by checking the list of files (data waiting to be sent)
in the table directory: /var/lib/clickhouse/data/database/table/."
让我们查看 /var/lib/clickhouse/data/database/table/-文件夹并检查 'hanging' bin-file 以找出问题的原因:
sudo vim /var/lib/clickhouse/data/database/table/default@../3757.bin
在 bin-file 的顶部驻留原始 sql-query 和查询设置。在我的例子中,readonly 设置为 1(见最后一行)是不允许执行插入的问题的根源(格式 bin-file 可以在将来更改并且输出将不同):
εû×^L<88>^H¡©^Cõ^FINSERT INTO database.table({column_list}) VALUES^V
use_uncompressed_cache^@^A0^N
load_balancing^@^F
random^Q
force_primary_key^@^A1^K
log_queries^@^A1^H
readonly^@^A1^P
..
要修复它需要:
修复根本原因(在我的例子中需要正确定义 default-profile)并检查测试插入是否正常工作
在集群的每个节点上做
移动(不是复制)'hanging' bin-file(s) 从 /var/lib/clickhouse/data/database/table/default@../
到 /var/lib/clickhouse/user_files/
从 CH 和 re-insert
打开文件
# check data availability
SELECT count()
FROM file('*.bin', 'Distributed')
# re-insert data
INSERT INTO database.table
SELECT *
FROM file('*.bin', 'Distributed')
# FROM file('3757.bin', 'Distributed')
- 从原始文件夹中删除已处理的 'hanging' 个文件
/var/lib/clickhouse/user_files/
我的二进制文件在数据中带有曲线(我的错)。 ClickHouse 无法将其插入 table 并停止处理其他数据。我刚刚打开二进制文件进行编辑并修复了错误的字段。在那之后,ClickHouse 拿走了文件并给出了关于无效校验和的错误。
default.affiliate_program.DirectoryMonitor: Code: 40, e.displayText() =
DB::Exception: Checksum of extra info doesn't match: corrupted data. Reference: cb322c17e14d6816abfcdc16842e7bdd. Actual: f4afe41e77b9a92bfa4048648a3aebbb.,
之后,ClickHouse将文件转移到损坏的文件夹中并继续。 是否可以更改校验和或任何其他用于处理我重写的文件的内容?
https://github.com/ClickHouse/ClickHouse/issues/16005
无法为分布式 table 更改 .bin 文件。它有 built-in 校验和,因此需要重新计算它,但这很麻烦。
但还有另一种方式。可以手动选择和插入未损坏的 .bin 文件 select * from file('/path/to/file.bin', 'Distributed')
我只是扩展了@Denny Crane 的原始问题和答案。
由于配置错误,我得到了类似的错误default-profile - it was marked as readonly。结果,随后向分布式 table 插入数据会导致如下错误:
database.table.DirectoryMonitor: Code: 164, e.displayText() =
DB::Exception: Received from **:9000.
DB::Exception: default: Cannot execute query in readonly mode. Stack trace:
0. Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x10519be0 in /usr/bin/clickhouse
1. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x8f5072d in /usr/bin/clickhouse
..
插入到分布式时table:
.. the data block is just written to the local file system. .. You should check whether data is sent successfully by checking the list of files (data waiting to be sent) in the table directory: /var/lib/clickhouse/data/database/table/."
让我们查看 /var/lib/clickhouse/data/database/table/-文件夹并检查 'hanging' bin-file 以找出问题的原因:
sudo vim /var/lib/clickhouse/data/database/table/default@../3757.bin
在 bin-file 的顶部驻留原始 sql-query 和查询设置。在我的例子中,readonly 设置为 1(见最后一行)是不允许执行插入的问题的根源(格式 bin-file 可以在将来更改并且输出将不同):
εû×^L<88>^H¡©^Cõ^FINSERT INTO database.table({column_list}) VALUES^V
use_uncompressed_cache^@^A0^N
load_balancing^@^F
random^Q
force_primary_key^@^A1^K
log_queries^@^A1^H
readonly^@^A1^P
..
要修复它需要:
修复根本原因(在我的例子中需要正确定义 default-profile)并检查测试插入是否正常工作
在集群的每个节点上做
移动(不是复制)'hanging' bin-file(s) 从
/var/lib/clickhouse/data/database/table/default@../
到/var/lib/clickhouse/user_files/
从 CH 和 re-insert
打开文件
# check data availability
SELECT count()
FROM file('*.bin', 'Distributed')
# re-insert data
INSERT INTO database.table
SELECT *
FROM file('*.bin', 'Distributed')
# FROM file('3757.bin', 'Distributed')
- 从原始文件夹中删除已处理的 'hanging' 个文件
/var/lib/clickhouse/user_files/