forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Describe the bug
CREATE TABLE left
(
`id` Int32,
`value` Int32,
`date_col` Date,
`value_minus` ALIAS value - 1
)
ENGINE = MergeTree
PARTITION BY toYYYYMM(date_col)
ORDER BY (date_col, id);
CREATE TABLE right
(
`id` Int32,
`value` Int32,
`date_col` Date,
`value_minus` ALIAS value - 1
)
ENGINE = MergeTree
PARTITION BY toYYYYMM(date_col)
ORDER BY (date_col, id);
CREATE TABLE hybrid_without_col_def
ENGINE = Hybrid(remote('localhost', currentDatabase(), 'left'), id < 4, remote('localhost', currentDatabase(), 'right'), id >= 4) SETTINGS allow_experimental_hybrid_table=1;
DROP TABLE right;
DETACH DATABASE default;
ATTACH DATABASE default;Output:
Received exception from server (version 25.8.14):
Code: 722. DB::Exception: Received from localhost:9000. DB::Exception: Waited job failed: Code: 695. DB::Exception: Load job 'load table default.hybrid_without_col_def' failed: Code: 60. DB::Exception: Table default.right does not exist: Cannot attach table `default`.`hybrid_without_col_def` from metadata file store/085/08594748-d4d8-4daa-a726-b07cb50ebf0c/hybrid_without_col_def.sql from query ATTACH TABLE default.hybrid_without_col_def UUID '5b681073-4f93-4866-b4f8-0e95e54f31cb' (`id` Int32, `value` Int32, `date_col` Date, `value_minus` Int64 ALIAS value - 1) ENGINE = Hybrid(remote('localhost', 'default', 'left'), id < 4, remote('localhost', currentDatabase(), 'right'), id >= 4). (UNKNOWN_TABLE),. (ASYNC_LOAD_WAIT_FAILED)
The same will happen on server restart (without attach detach) and after that server is not fully usable (show queries do not work).
Trace:
[clickhouse1] 2026.01.27 17:49:40.031738 [ 65 ] {03e62ae7-4660-4170-a7b2-d3c73df079c9} <Error> executeQuery: Code: 722. DB::Exception: Waited job failed: Code: 695. DB::Exception: Load job 'load table default.hybrid_without_col_def' failed: Code: 60. DB::Exception: Table default.right does not exist: Cannot attach table `default`.`hybrid_without_col_def` from metadata file store/085/08594748-d4d8-4daa-a726-b07cb50ebf0c/hybrid_without_col_def.sql from query ATTACH TABLE default.hybrid_without_col_def UUID '5b681073-4f93-4866-b4f8-0e95e54f31cb' (`id` Int32, `value` Int32, `date_col` Date, `value_minus` Int64 ALIAS value - 1) ENGINE = Hybrid(remote('localhost', 'default', 'left'), id < 4, remote('localhost', currentDatabase(), 'right'), id >= 4). (UNKNOWN_TABLE), Stack trace (when copying this message, always include the lines below):
0. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x0000000010eab2b0
1. DB::Exception::Exception(String&&, int, String, bool) @ 0x000000000b944a58
2. DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000b944528
3. DB::Exception::Exception<String, String>(int, FormatStringHelperImpl<std::type_identity<String>::type, std::type_identity<String>::type>, String&&, String&&) @ 0x000000000b943f3c
4. DB::IDatabase::getTable(String const&, std::shared_ptr<DB::Context const>) const @ 0x00000000146953c0
5. DB::DatabaseCatalog::getTableImpl(DB::StorageID const&, std::shared_ptr<DB::Context const>, std::optional<DB::Exception>*) const @ 0x0000000015106100
6. DB::DatabaseCatalog::getTable(DB::StorageID const&, std::shared_ptr<DB::Context const>) const @ 0x000000001510eb40
7. DB::getStructureOfRemoteTableInShard(DB::Cluster const&, DB::Cluster::ShardInfo const&, DB::StorageID const&, std::shared_ptr<DB::Context const>, std::shared_ptr<DB::IAST> const&) @ 0x0000000015ec0894
8. DB::getStructureOfRemoteTable(DB::Cluster const&, DB::StorageID const&, std::shared_ptr<DB::Context const>, std::shared_ptr<DB::IAST> const&) @ 0x0000000015ec3660
9. DB::TableFunctionRemote::getActualTableStructure(std::shared_ptr<DB::Context const>, bool) const @ 0x0000000012e750c8
10. std::shared_ptr<DB::IStorage> std::__function::__policy_invoker<std::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>::__call_impl[abi:ne190107]<std::__function::__default_alloc_func<DB::registerStorageHybrid(DB::StorageFactory&)::$_0, std::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>>(std::__function::__policy_storage const*, DB::StorageFactory::Arguments const&) (.llvm.13185195428035567561) @ 0x0000000015b898b4
11. DB::StorageFactory::get(DB::ASTCreateQuery const&, String const&, std::shared_ptr<DB::Context>, std::shared_ptr<DB::Context>, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, DB::LoadingStrictnessLevel, bool) const @ 0x0000000015b93120
12. DB::createTableFromAST(DB::ASTCreateQuery, String const&, String const&, std::shared_ptr<DB::Context>, DB::LoadingStrictnessLevel) @ 0x0000000014610704
13. DB::DatabaseOrdinary::loadTableFromMetadata(std::shared_ptr<DB::Context>, String const&, DB::QualifiedTableName const&, std::shared_ptr<DB::IAST> const&, DB::LoadingStrictnessLevel) @ 0x000000001462332c
14. void std::__function::__policy_invoker<void (DB::AsyncLoader&, std::shared_ptr<DB::LoadJob> const&)>::__call_impl[abi:ne190107]<std::__function::__default_alloc_func<DB::DatabaseOrdinary::loadTableFromMetadataAsync(DB::AsyncLoader&, std::unordered_set<std::shared_ptr<DB::LoadJob>, std::hash<std::shared_ptr<DB::LoadJob>>, std::equal_to<std::shared_ptr<DB::LoadJob>>, std::allocator<std::shared_ptr<DB::LoadJob>>>, std::shared_ptr<DB::Context>, String const&, DB::QualifiedTableName const&, std::shared_ptr<DB::IAST> const&, DB::LoadingStrictnessLevel)::$_0, void (DB::AsyncLoader&, std::shared_ptr<DB::LoadJob> const&)>>(std::__function::__policy_storage const*, DB::AsyncLoader&, std::shared_ptr<DB::LoadJob> const&) @ 0x000000001462f4c0
15. void std::__function::__policy_invoker<void ()>::__call_impl[abi:ne190107]<std::__function::__default_alloc_func<DB::AsyncLoader::spawn(DB::AsyncLoader::Pool&, std::unique_lock<std::mutex>&)::$_0, void ()>>(std::__function::__policy_storage const*) @ 0x00000000111a6568
16. ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::worker() @ 0x0000000010fdd2fc
17. void std::__function::__policy_invoker<void ()>::__call_impl[abi:ne190107]<std::__function::__default_alloc_func<ThreadFromGlobalPoolImpl<false, true>::ThreadFromGlobalPoolImpl<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&&)::'lambda'(), void ()>>(std::__function::__policy_storage const*) @ 0x0000000010fe36e0
18. ThreadPoolImpl<std::thread>::ThreadFromThreadPool::worker() @ 0x0000000010fda84c
19. void* std::__thread_proxy[abi:ne190107]<std::tuple<std::unique_ptr<std::__thread_struct, std::default_delete<std::__thread_struct>>, void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::thread>::ThreadFromThreadPool*>>(void*) @ 0x0000000010fe185c
20. ? @ 0x000000000007d5b8
21. ? @ 0x00000000000e5edc
(version 25.8.14.20001.altinityantalya). (ASYNC_LOAD_FAILED) (version 25.8.14.20001.altinityantalya). (ASYNC_LOAD_WAIT_FAILED) (version 25.8.14.20001.altinityantalya) (from 127.0.0.1:43682) (query 1, line 1) (in query: attach database default), Stack trace (when copying this message, always include the lines below):
0. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x0000000010eab2b0
1. DB::Exception::Exception(String&&, int, String, bool) @ 0x000000000b944a58
2. DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000b944528
3. DB::Exception::Exception<String>(int, FormatStringHelperImpl<std::type_identity<String>::type>, String&&) @ 0x000000000b944138
4. DB::AsyncLoader::wait(std::shared_ptr<DB::LoadJob> const&, bool) @ 0x000000001119fe8c
5. DB::waitLoad(unsigned long, std::vector<std::shared_ptr<DB::LoadTask>, std::allocator<std::shared_ptr<DB::LoadTask>>> const&, bool) @ 0x00000000111837bc
6. DB::InterpreterCreateQuery::createDatabase(DB::ASTCreateQuery&) @ 0x00000000151ce488
7. DB::InterpreterCreateQuery::execute() @ 0x00000000151ef454
8. DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, std::unique_ptr<DB::ReadBuffer, std::default_delete<DB::ReadBuffer>>&, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::ImplicitTransactionControlExecutor>) @ 0x00000000155a57c8
9. DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x00000000155a0c28
10. DB::TCPHandler::runImpl() @ 0x00000000169a8510
11. DB::TCPHandler::run() @ 0x00000000169c4f28
12. Poco::Net::TCPServerConnection::start() @ 0x000000001b4cd018
13. Poco::Net::TCPServerDispatcher::run() @ 0x000000001b4cd5b4
14. Poco::PooledThread::run() @ 0x000000001b492edc
15. Poco::ThreadImpl::runnableEntry(void*) @ 0x000000001b491250
16. ? @ 0x000000000007d5b8
17. ? @ 0x00000000000e5edc