инструкции
В итоге сервер лежит
И выводит сообщение
2020.09.08 19:35:31.194915 [ 1 ] {} <Error> Application: Caught exception while loading metadata: Code: 342, e.displayText() = DB::Exception: Existing table metadata in ZooKeeper differs in primary key. Stored in ZooKeeper: date, s2_hash, u_id, version, local: date, s2_hash, u_id: Cannot attach table `data`.`local_daily` from metadata file /var/lib/clickhouse/metadata/data/local_daily.sql from query ATTACH TABLE data.local_daily (`date` Date CODEC(Delta(2), LZ4), `s2_hash` Int64 CODEC(Delta(8), LZ4), `u_id` Int64 CODEC(Delta(8), LZ4), `sign` Int8 CODEC(Delta(1), LZ4), `version` UInt8 CODEC(Delta(1), LZ4)) ENGINE = ReplicatedVersionedCollapsingMergeTree('/clickhouse/tables/{shard}/local_daily', '{replica}', sign, version) ORDER BY (date, s2_hash, u_id) SETTINGS index_granularity = 8192, Stack trace (when copying this message, always include the lines below):
0. Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x1271b990 in /usr/bin/clickhouse
1. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0xa3f32bd in /usr/bin/clickhouse
2. ? @ 0xfdd4eea in /usr/bin/clickhouse
3. DB::ReplicatedMergeTreeTableMetadata::checkEquals(DB::ReplicatedMergeTreeTableMetadata const&, DB::ColumnsDescription const&, DB::Context const&) const @ 0xfdd2d89 in /usr/bin/clickhouse
4. DB::StorageReplicatedMergeTree::checkTableStructure(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&) @ 0xfa1ff0e in /usr/bin/clickhouse
5. DB::StorageReplicatedMergeTree::StorageReplicatedMergeTree(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, DB::StorageID const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::StorageInMemoryMetadata const&, DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::MergeTreeData::MergingParams const&, std::__1::unique_ptr<DB::MergeTreeSettings, std::__1::default_delete<DB::MergeTreeSettings> >, bool) @ 0xfa46d55 in /usr/bin/clickhouse
6. ? @ 0xfde0b59 in /usr/bin/clickhouse
7. std::__1::__function::__func<std::__1::shared_ptr<DB::IStorage> (*)(DB::StorageFactory::Arguments const&), std::__1::allocator<std::__1::shared_ptr<DB::IStorage> (*)(DB::StorageFactory::Arguments const&)>, std::__1::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>::operator()(DB::StorageFactory::Arguments const&) @ 0xfde4cf7 in /usr/bin/clickhouse
8. DB::StorageFactory::get(DB::ASTCreateQuery const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, DB::Context&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, bool) const @ 0xf9760b1 in /usr/bin/clickhouse
9. DB::createTableFromAST(DB::ASTCreateQuery, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, bool) @ 0xf329a09 in /usr/bin/clickhouse
10. ? @ 0xf31d8d1 in /usr/bin/clickhouse
11. ? @ 0xf31e271 in /usr/bin/clickhouse
12. ThreadPoolImpl<ThreadFromGlobalPool>::worker(std::__1::__list_iterator<ThreadFromGlobalPool, void*>) @ 0xa421557 in /usr/bin/clickhouse
13. ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&, void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()&&...
возможно баг Existing table metadata in ZooKeeper differs in primary key. Stored in ZooKeeper: date, s2_hash, u_id, version, date, s2_hash, u_id ATTACH TABLE data.local_daily () ENGINE = ReplicatedVersionedCollapsingMergeTree('/clickhouse/tables/{shard}/local_daily', '{replica}', sign, version) ORDER BY (date, s2_hash, u_id) я бы откатывался
https://github.com/ClickHouse/ClickHouse/issues/12093
Обсуждают сегодня