Skip to content

Logical error: Table A.B not found in catalog (STID: 3215-370f) #106906

Closed

Description

@jkartseva

Important: This issue was automatically generated and is used by CI for matching failures. DO NOT modify the body content. DO NOT remove labels.

Test name: Logical error: Table A.B not found in catalog (STID: 3215-370f)
CI report: Stress test (arm_asan_ubsan)
Failing test history: cidb

Test output:

Log files: clickhouse-server.err.log, stderr.log
Error:
Logical error: 'Table test_ffsj99fm.t_cnt not found in catalog'.
---

Stack trace:
__pthread_kill_implementation @ 0x0000000000082009
raise @ 0x000000000003a83c
__GI_abort @ 0x0000000000027134
src/Common/Exception.cpp:60:5: DB::abortOnFailedAssertion(String const&, std::basic_string_view<char, std::char_traits<char>>, void* const*, unsigned long, unsigned long) @ 0x000000002b7c1f18
src/Common/Exception.cpp:93:13: DB::handle_error_code(String const&, std::basic_string_view<char, std::char_traits<char>>, int, bool, std::vector<void*, std::allocator<void*>> const&) @ 0x000000002b7c42b4
src/Common/Exception.cpp:146:19: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000002b7c482c
src/Common/Exception.h:171:100: DB::Exception::Exception(String&&, int, String, bool) @ 0x000000001c546c28
src/Common/Exception.h:57:54: DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000001c5456ac
src/Common/Exception.h:189:77: DB::Exception::Exception<String&, String&>(int, FormatStringHelperImpl<std::type_identity<String&>::type, std::type_identity<String&>::type>, String&, String&) @ 0x0000000027f3b86c
src/Processors/QueryPlan/ReadFromMergeTree.cpp:4904:15: DB::ReadFromMergeTree::deserialize(DB::IQueryPlanStep::Deserialization&) @ 0x000000004981c2d4
inlined from contrib/llvm-project/libcxx/include/__functional/function.h:502: ?
inlined from contrib/llvm-project/libcxx/include/__functional/function.h:754: ?
src/Processors/QueryPlan/QueryPlanStepRegistry.cpp:37:12: DB::QueryPlanStepRegistry::createStep(String const&, DB::IQueryPlanStep::Deserialization&) const @ 0x000000004979f060
src/Processors/QueryPlan/Serialization.cpp:226:35: DB::QueryPlan::deserialize(DB::ReadBuffer&, std::shared_ptr<DB::Context const> const&, DB::QueryPlan::SerializationFlags const&) @ 0x000000004997c424
src/Processors/QueryPlan/Serialization.cpp:171:12: DB::QueryPlan::deserialize(DB::ReadBuffer&, std::shared_ptr<DB::Context const> const&) @ 0x000000004997aca4
inlined from src/QueryPipeline/DistributedPlanExecutor.cpp:573: DB::deserializeQueryPlan(String const&, std::shared_ptr<DB::Context const>)
src/QueryPipeline/DistributedPlanExecutor.cpp:644:26: DB::doExecuteTask(DB::DistributedQueryTaskDescription const&, std::shared_ptr<DB::IObjectStorage>, String const&, String const&, std::shared_ptr<DB::Context>, std::function<bool ()>, std::function<void (DB::Progress const&)>) @ 0x00000000485e290c
inlined from src/QueryPipeline/DistributedPlanExecutor.cpp:737: DB::executeTask(StrongTypedef<wide::integer<128ul, unsigned int>, DB::UUIDTag> const&, DB::DistributedQueryTaskDescription const&, std::shared_ptr<DB::Context const>, std::shared_ptr<std::atomic<bool>>)
src/QueryPipeline/DistributedPlanExecutor.cpp:786:5: DB::DistributedQueryPlanExecutorLocal::startTask(DB::DistributedQueryTaskDescription const&)::'lambda'()::operator()() @ 0x00000000485f5a94

Version info

Activity

  1. added
    testing
    fuzz
    on Jun 10, 2026
  2. PedroTadim commented on Jun 10, 2026

    @PedroTadim
    Member

    @groeneai you know what to do, fix this!

  3. PedroTadim commented on Jun 10, 2026

    @PedroTadim
    Member

    @groeneai don't do anything, let @davenger do it

  4. Algunenano commented on Jun 10, 2026

    @Algunenano
    Member

    Root cause

    This started after #106020 (multistage_distributed_queries) was merged into master on 2026-06-09 15:25 UTC. The first failures in CIDB appear at 2026-06-09 17:14 UTC and then show up on essentially every stress run across all build types, including runs with pull_request_number = 0 (master itself). The PRs in whose CI this shows up are unrelated to the failure; they just inherited the regression from master.

    The abort comes from the distributed-plan worker path that the PR added. With make_distributed_plan = 1, the coordinator serializes the query plan and ships it to a stateless worker, which deserializes it and re-resolves each ReadFromMergeTree source by database.name:

    src/Processors/QueryPlan/ReadFromMergeTree.cpp:4901

    StorageID table_id(database_name, table_name);
    auto storage_ptr = DatabaseCatalog::instance().tryGetTable(table_id, ctx.context);
    if (!storage_ptr)
        throw Exception(ErrorCodes::LOGICAL_ERROR, "Table {}.{} not found in catalog", database_name, table_name);

    When tryGetTable returns null, the code throws LOGICAL_ERROR, which aborts the server in debug and sanitizer builds.

    A missing table at worker-side deserialization is a reachable runtime condition, not an invariant violation. Under stress (parallel test runs, concurrent drops and teardown, restarts, lagging worker tasks) the name lookup misses and the whole server goes down. Multiple unrelated tests reproduce it with different table names (t_cnt, test_3, t_agg_persisted, small), which confirms it is a general defect in the worker path rather than a single test.

    CI report (arm_debug): https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=106855&sha=0b098b3f5137ec616708f8fd2a5e89b3a5330f6c&name_0=PR&name_1=Stress%20test%20%28arm_debug%29

    Caused by: #106020

  5. added a commit that references this issue on Jun 10, 2026
    d260520
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

fuzztesting

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions