Skip to content

[CI crash] Limit step addition failed in query plan #86980

@robot-clickhouse

Description

@robot-clickhouse
Stack trace details

The sipHash64(st.trace_full) is 1974832886724432347
The trace is from the master or release branch: True

The query for CIDB to compare the trace with the known one:

WITH
    (
        SELECT groupArrayDistinct(cleanStackTrace(trace_full) AS trace) FROM default.stack_traces
        WHERE sipHash64(trace) IN (1974832886724432347, {ANOTHER_TRACE_HASH}) -- FIXME: replace with the known hash
    ) AS traces,
    1.97 AS alpha,
    stack_frame_weights AS (
        WITH
            (
                SELECT count()
                FROM default.stack_traces
                FINAL
            ) AS total,
            2.0 AS beta,
            3.7 AS gamma
        SELECT
            arrayJoin(cleanStackTrace(trace_full)) AS frame,
            countDistinct(trace_full) AS count,
            log(total / count) AS IDF,
            sigmoid(beta * (IDF - gamma)) AS weight
        FROM default.stack_traces
        FINAL
        GROUP BY frame
    ),
    (SELECT groupArray(weight) AS w, groupArray(frame) AS f FROM stack_frame_weights) AS weights,
    (trace -> arrayMap((_frame, pos) -> (pow(pos, -alpha) * arrayFirst(w, f -> (f = _frame), weights.w, weights.f)), trace, arrayEnumerate(trace))) AS get_trace_weights,
    (arr -> arrayStringConcat(arr, '\n')) AS joinArr

SELECT arraySimilarity(traces[1], traces[2], get_trace_weights(traces[1]) AS weights1, get_trace_weights(traces[2]) AS weights2) AS similarity,
    arrayLevenshteinDistanceWeighted(traces[1], traces[2], weights1, weights2),
    joinArr(traces[1]), joinArr(traces[2]), joinArr(weights1), joinArr(weights2)

The following new stack trace from CI Logs system.crash_log found:

   DB::abortOnFailedAssertion(String const&, void* const*, unsigned long, unsigned long)
   DB::handle_error_code(String const&, std::basic_string_view<char, std::char_traits<char>>, int, bool, std::vector<void*, std::allocator<void*>> const&)
   DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool)
   DB::Exception::Exception(String&&, int, String, bool)
   DB::Exception::Exception(PreformattedMessage&&, int)
   DB::Exception::Exception<>(int, FormatStringHelperImpl<>)
   DB::(anonymous namespace)::addLimitStep(DB::QueryPlan&, DB::(anonymous namespace)::QueryAnalysisResult const&, std::shared_ptr<DB::PlannerContext> const&, DB::QueryNode const&)
   DB::Planner::buildPlanForQueryNode()
   DB::Planner::buildQueryPlanIfNeeded()
   DB::InterpreterSelectQueryAnalyzer::getQueryPlan()
   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>)
   DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum)
   DB::TCPHandler::runImpl()
   DB::TCPHandler::run()
   Poco::Net::TCPServerConnection::start()
   Poco::Net::TCPServerDispatcher::run()
   Poco::PooledThread::run()
   Poco::ThreadImpl::runnableEntry(void*)

Possible causes:

  • Invalid query analysis result during limit step addition
  • Incorrect query node configuration
  • Mismatch between query plan and query analysis
  • Incorrect planner context during plan construction

The stack trace appeared in the following checks:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions