Code: 33. DB::Exception: Cannot read all data. Bytes read: 0. Bytes expected: 3. (CANNOT_READ_ALL_DATA), Stack trace (when copying this message, always include the lines below):
0. ./clickhouse_build/../src/Common/Exception.cpp:69: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0xa5d28da in /clickhouse/bin/clickhouse
1. ./clickhouse_build/../src/IO/ReadBuffer.h:0: DB::ReadBuffer::readStrict(char*, unsigned long) @ 0xa62a5a2 in /clickhouse/bin/clickhouse
2. ./clickhouse_build/../src/IO/MySQLPacketPayloadReadBuffer.cpp:28: DB::MySQLPacketPayloadReadBuffer::nextImpl() @ 0x1495a865 in /clickhouse/bin/clickhouse
3. ./clickhouse_build/../src/IO/ReadBuffer.h:65: DB::MySQLReplication::MySQLFlavor::readPayloadAndFun(DB::ReadBuffer&, unsigned char&, bool, std::__1::function<bool (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)> const&) @ 0x14971e35 in /clickhouse/bin/clickhouse
4. ./clickhouse_build/../contrib/libcxx/include/__memory/shared_ptr.h:594: DB::MaterializedMySQLSyncThread::synchronization() @ 0x14baecd5 in /clickhouse/bin/clickhouse
5. ./clickhouse_build/../src/Databases/MySQL/MaterializedMySQLSyncThread.cpp:0: void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPoolImpl<true>::ThreadFromGlobalPoolImpl<DB::MaterializedMySQLSyncThread::startSynchronization()::$_1>(DB::MaterializedMySQLSyncThread::startSynchronization()::$_1&&)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) @ 0x14bce18c in /clickhouse/bin/clickhouse
6. ./clickhouse_build/../base/base/../base/wide_integer_impl.h:772: ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0xa67a575 in /clickhouse/bin/clickhouse
7. ./clickhouse_build/../contrib/libcxx/include/__memory/unique_ptr.h:312: void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>, bool)::'lambda0'()> >(void*) @ 0xa67f27d in /clickhouse/bin/clickhouse
8. ? @ 0x7f0c13828609 in ?
9. __clone @ 0x7f0c1374d133 in ?
(version 22.8.5.29)
1,用clickhouse自带的MaterializeMySQL引擎,同步mysql数据时报了上述错误
2,解决思路:
1)clickhouse 内存是否已经占满,如果一次向CH当中插入过多的数据,会出现这种情况
2)CH 这边要同步MySQL的数据是根据binlog来同步的,刚才的报错是binlog被服务端清理掉了。两种情况(1)binlog 过期时间太短了。(2)RDS 还有一种策略是磁盘满了,也会清理binlog.
3) 解决办法: 升级内存等硬件,修改binlog过期策略,重建MM映射表~