获取异常表间歇性地处于只读模式

问题描述

在我的应用程序中,间歇执行Clickhouse插入查询时,我遇到以下异常

代码:242,e.displayText()= DB :: Exception:表处于只读模式(版本19.14.6.12)

在Clickhouse服务器的错误日志中,在相同时间戳下观察到异常以下情况。


0. 0x3353de0 StackTrace::StackTrace() /usr/bin/clickhouse
1. 0x66f25e8 ? /usr/bin/clickhouse
2. 0x66f2d0b Coordination::Exception::Exception(std::string const&,int) /usr/bin/clickhouse
3. 0x6708c75 Coordination::ZooKeeper::receiveThread() /usr/bin/clickhouse
4. 0x6708dc4 ? /usr/bin/clickhouse
5. 0x338cb43 ThreadPoolImpl<std::thread>::worker(std::_List_iterator<std::thread>) /usr/bin/clickhouse
6. 0x766d06f ? /usr/bin/clickhouse
7. 0x7fb7ac0f9dd5 start_thread /usr/lib64/libpthread-2.17.so
8. 0x7fb7aba1702d __clone /usr/lib64/libc-2.17.so
 (version 19.14.6.12)
2020.10.21 02:37:16.915321 [ 36 ] {} <Error> leaderElection (/clickhouse/test_db/tables/1/test_db.manager_table/leader_election): Code: 999,e.displayText() = Coordination::Exception: Session expired (Session expired),Stack trace:

0. 0x3353de0 StackTrace::StackTrace() /usr/bin/clickhouse
1. 0x66f25e8 ? /usr/bin/clickhouse
2. 0x66f2d0b Coordination::Exception::Exception(std::string const&,int) /usr/bin/clickhouse
3. 0x6709074 Coordination::ZooKeeper::pushRequest(Coordination::ZooKeeper::RequestInfo&&) /usr/bin/clickhouse
4. 0x6709f87 Coordination::ZooKeeper::list(std::string const&,std::function<void (Coordination::ListResponse const&)>,std::function<void (Coordination::WatchResponse const&)>) /usr/bin/clickhouse
5. 0x66f8a91 zkutil::ZooKeeper::getChildrenImpl(std::string const&,std::vector<std::string,std::allocator<std::string> >&,Coordination::Stat*,std::function<void (Coordination::WatchResponse const&)>) /usr/bin/clickhouse
6. 0x66faa5c zkutil::ZooKeeper::tryGetChildren(std::string const&,std::shared_ptr<Poco::Event> const&) /usr/bin/clickhouse
7. 0x66faaea zkutil::ZooKeeper::getChildren(std::string const&,std::shared_ptr<Poco::Event> const&) /usr/bin/clickhouse
8. 0x6132a55 zkutil::leaderElection::threadFunction() /usr/bin/clickhouse
9. 0x63f89f4 DB::BackgroundSchedulePoolTaskInfo::execute() /usr/bin/clickhouse
10. 0x63f95c2 DB::BackgroundSchedulePool::threadFunction() /usr/bin/clickhouse
11. 0x63f9624 ? /usr/bin/clickhouse
12. 0x338cb43 ThreadPoolImpl<std::thread>::worker(std::_List_iterator<std::thread>) /usr/bin/clickhouse
13. 0x766d06f ? /usr/bin/clickhouse
14. 0x7fb7ac0f9dd5 start_thread /usr/lib64/libpthread-2.17.so
15. 0x7fb7aba1702d __clone /usr/lib64/libc-2.17.so
 (version 19.14.6.12)
clickhouse-driver version
ru.yandex.clickhouse clickhouse-jdbc 0.1.54```


**clickhouse-server version**
19.14.6

This seems zookeeper issue,for same timestamp I verified zookeeper logs as well but no error observed. Let me kNow how can we fix this issue.

解决方法

19.14.6.12已停止支持。

这是ZK问题。检查所有动物园管理员。

与ZK进行CH通讯时可能是网络问题。