-
Notifications
You must be signed in to change notification settings - Fork 8.3k
optimize fail when no data in partition in replicated table #49201
Description
Hello,
I have a problem when I play an optimize on a ReplicatedMergeTree table.
When I use the command optimize table T1 partition tuple('2023-04-22') final deduplicate by * I get an error Code: 999. Coordination::Exception: Transaction failed (No node): Op #0
I have ReplicatedMergeTree table with partitions at the days. When there is no data at the day 2023-04-22 in table, optimize table command failed
ClickHouse version is 23.3.1.2823
Here is the log:
@timestamp:Apr 25, 2023 @ 18:42:25.157 agent.ephemeral_id:2a9305ed-2ecb-42d7-bc50-df29d009dfb0 agent.ephemeral_id.keyword:2a9305ed-2ecb-42d7-bc50-df29d009dfb0 agent.hostname:os-010000111 agent.hostname.keyword:os-010000111 agent.id:105eeed5-639e-413b-ae39-9a4dc2bc8d68 agent.id.keyword:105eeed5-639e-413b-ae39-9a4dc2bc8d68 agent.name:os-010000111 agent.name.keyword:os-010000111 agent.type:filebeat agent.type.keyword:filebeat agent.version:7.17.8 agent.version.keyword:7.17.8 application:clickhouse application.keyword:clickhouse ecs.version:1.12.0 ecs.version.keyword:1.12.0 input.type:log input.type.keyword:log level:Error level.keyword:Error log.file.path:/var/log/clickhouse-server/clickhouse-server.err.log log.file.path.keyword:/var/log/clickhouse-server/clickhouse-server.err.log log.flags:multiline log.flags.keyword:multiline log.offset:204,906,082 message:2023.04.25 15:42:20.429105 [ 994975 ] {6f03244d-65bf-4928-8b83-a2e2c875af1a}
executeQuery: Code: 999. Coordination::Exception: Transaction failed (No node): Op #0, path: /clickhouse/tables/main_shard/eds/events_r/block_numbers/20230422. (KEEPER_EXCEPTION) (version 23.3.1.2823 (official build)) (from 10.33.0.53:49242) (in query: optimize table eds.events_r partition tuple('2023-04-22') final deduplicate by * settings distributed_ddl_task_timeout = -1), Stack trace (when copying this message, always include the lines below):
- DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0xe18d895 in /usr/bin/clickhouse
- Coordination::Exception::Exception(String const&, Coordination::Error, int) @ 0x14e9aeb0 in /usr/bin/clickhouse
- Coordination::Exception::Exception(String const&, Coordination::Error) @ 0x14e9b1d8 in /usr/bin/clickhouse
- zkutil::KeeperMultiException::KeeperMultiException(Coordination::Error, std::vector<std::shared_ptrCoordination::Request, std::allocator<std::shared_ptrCoordination::Request>> const&, std::vector<std::shared_ptrCoordination::Response, std::allocator<std::shared_ptrCoordination::Response>> const&) @ 0x14eb1904 in /usr/bin/clickhouse
- zkutil::KeeperMultiException::check(Coordination::Error, std::vector<std::shared_ptrCoordination::Request, std::allocator<std::shared_ptrCoordination::Request>> const&, std::vector<std::shared_ptrCoordination::Response, std::allocator<std::shared_ptrCoordination::Response>> const&) @ 0x14ea6812 in /usr/bin/clickhouse
- ? @ 0x1407489b in /usr/bin/clickhouse
- ? @ 0x14074614 in /usr/bin/clickhouse
- DB::ReplicatedMergeTreeMergePredicate::ReplicatedMergeTreeMergePredicate(DB::ReplicatedMergeTreeQueue&, std::shared_ptrzkutil::ZooKeeper&, std::unordered_set<String, std::hash, std::equal_to, std::allocator>&&) @ 0x14703d36 in /usr/bin/clickhouse
- ? @ 0x13ff4827 in /usr/bin/clickhouse
- DB::StorageReplicatedMergeTree::optimize(std::shared_ptrDB::IAST const&, std::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::shared_ptrDB::IAST const&, bool, bool, std::vector<String, std::allocator> const&, bool, std::shared_ptr<DB::Context const>) @ 0x13ff38c7 in /usr/bin/clickhouse
- DB::InterpreterOptimizeQuery::execute() @ 0x13742c30 in /usr/bin/clickhouse
- ? @ 0x13b18da7 in /usr/bin/clickhouse
- DB::executeQuery(DB::ReadBuffer&, DB::WriteBuffer&, bool, std::shared_ptrDB::Context, std::function<void (DB::QueryResultDetails const&)>, std::optionalDB::FormatSettings const&) @ 0x13b1eb6c in /usr/bin/clickhouse
- DB::HTTPHandler::processQuery(DB::HTTPServerRequest&, DB::HTMLForm&, DB::HTTPServerResponse&, DB::HTTPHandler::Output&, std::optionalDB::CurrentThread::QueryScope&) @ 0x14893413 in /usr/bin/clickhouse
- DB::HTTPHandler::handleRequest(DB::HTTPServerRequest&, DB::HTTPServerResponse&) @ 0x1489772e in /usr/bin/clickhouse
- DB::HTTPServerConnection::run() @ 0x1490617d in /usr/bin/clickhouse
- Poco::Net::TCPServerConnection::start() @ 0x17838054 in /usr/bin/clickhouse
- Poco::Net::TCPServerDispatcher::run() @ 0x1783927b in /usr/bin/clickhouse
- Poco::PooledThread::run() @ 0x179c0b07 in /usr/bin/clickhouse
- Poco::ThreadImpl::runnableEntry(void*) @ 0x179be53d in /usr/bin/clickhouse
- start_thread @ 0x7ea7 in /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
- clone @ 0xfca2f in /usr/lib/x86_64-linux-gnu/libc-2.31.so threadId: 994975 threadId.keyword: 994975