Skip to content

[Bug]: Dev AP q1811 exceeds configured 7200s SQL timeout without cancellation #28007

Closed

Description

@Ariznawlll

Description

In the dev AP regression workload, @q1811_adv_range_frame_wsl continues running beyond the configured 7200-second SQL timeout. The runner does not emit a timeout result or advance to the next case.

Environment

  • Workflow branch: codex/mo-ap-regression-dev-assets
  • Workflow commit: 138640f241f17d28910c366324ab31893ae9ec56
  • Deployment: dev freetier cluster with the OSS-loaded jinpan_001 dataset
  • MatrixOne build SHA: not emitted by this workflow; needs confirmation during triage
  • Date: 2026-09-02

Steps to reproduce

  1. Dispatch MO AP Regression (Dev) with test_phase=all, data_mode=fresh.
  2. Allow the advanced join shard 0 to execute tools/mo-regression-test/cases/jinpan_001/join_adv/j_batch_041.sql.
  3. Observe @q1811_adv_range_frame_wsl, which performs a window aggregate over dwd_dcp.dwd_s4_acdoca and a left join to dwd_dcp.dwd_bw_ztbpc002_com.

The workflow invokes this case with --sql-timeout 7200.

Actual behavior

  • The previous @q1810_adv_invoice_having_avg completed in 71,544.40 ms at 2026-09-02 14:25:08 +08:00.
  • @q1811_adv_range_frame_wsl then started at the same time and was still running at 2026-09-02 18:11 +08:00, over 3 hours 46 minutes later.
  • No cost: line, SQL error, or Execution timeout after 7200s line was emitted for q1811.
  • The Advanced Join job therefore remains active and blocks the remaining serialized shards.

Expected behavior

The query should either complete, return a MatrixOne error, or be canceled and reported by the regression runner no later than the configured 7200-second SQL timeout. A single SQL statement must not keep the regression shard running past its configured timeout.

Stability and controls

  • Reproducer: 1/1 on the current dev workload.
  • Control: q1810 in the same connection completed successfully immediately before q1811.
  • Scope: this report establishes the timeout/hang symptom on dev only. Reproduction on the latest official main has not yet been performed.

Evidence

Code analysis

The regression runner wraps cursor.execute() and cursor.fetchall() with func_timeout(7200, ...) and configures PyMySQL read_timeout/write_timeout to the same value. The observed duration exceeds both values. It is not yet confirmed whether the root cause is a MatrixOne query that does not return/cancel, or a client-side timeout that cannot interrupt this operation.

Regression coverage

After root cause is fixed, add a bounded big-data/AP regression that verifies a long-running query exits at the configured SQL timeout and the runner continues with the next case.

Activity

  1. added this to the MO-202609 milestone on Sep 2, 2026
  2. added
    kind/bug
    on Sep 2, 2026
  3. Ariznawlll commented on Sep 4, 2026

    @Ariznawlll
    CollaboratorAuthor

    Additional RANGE-frame evidence from Jinpan AP regression

    The original q1811_adv_range_frame_wsl report is not isolated. In the same dev AP workflow, multiple RANGE-frame Window SQL statements independently consumed the full configured 7200-second limit and were canceled by the runner.

    Environment

    Timed-out cases

    • q1442_adv_range_frame_wsl
    • q1524_adv_range_frame_wsl
    • q1606_adv_range_frame_wsl
    • q1647_adv_range_frame_wsl
    • q1729_adv_range_frame_wsl
    • q1811_adv_range_frame_wsl

    Each reached the same runner message:

    Execution timeout after 7200s; skips remaining SQL in the current file and continues with the next file...
    

    Interpretation

    This is a repeatable query-shape performance problem, not merely a timeout-delivery problem for q1811. All listed cases use a RANGE-based window-frame pattern over large Jinpan AP tables. The runner now successfully cancels and advances after 7200 seconds, so the remaining product symptom is that these SQL statements require at least two hours to execute.

    Exclusions

    Evidence

  4. aptend commented on Sep 7, 2026

    @aptend
    Contributor

    Latest main code-path update (2026-09-07)

    Reviewed against main@bcd5ed833b5400fe95f322e4028adb2bde3de0a4. The original run used the diverged 4.2 dev build 4f62825d3; current main has relevant Window improvements, but the exact reported frame is not yet covered by a linear evaluator.

    Relevant merged changes:

    All six reported Jinpan cases use the same frame:

    SUM(a.wsl) OVER (
      PARTITION BY a.rbukrs
      ORDER BY CAST(a.wsl AS DECIMAL(23,2))
      RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
    )

    This exact shape does not match #27940: the new bounded RANGE path requires a finite start, while the existing cumulative fast path accepts only ROWS. It therefore still falls back to the generic per-output-row frame refill path. Lazy output may reduce observed work under LIMIT, but it does not close the worst-case algorithmic behavior, especially for large peer groups or full result consumption.

    The remaining execution change is a peer-aware cumulative RANGE path: add every peer group to one retained running aggregate, then reuse the same snapshot for every row in that peer group. That reduces aggregate work to O(N) while preserving RANGE CURRENT ROW peer semantics.

    This is static code-path evidence, not a latest-main replay. Keep the issue open until the same jinpan_001 query is run on latest main with recorded EXPLAIN ANALYZE, elapsed time, correct results, and bounded cancellation.

  5. added theissue type on Sep 23, 2026
  6. assigned and unassigned on Oct 26, 2026
  7. Ariznawlll commented on Oct 29, 2026

    @Ariznawlll
    CollaboratorAuthor

    dev环境现在已经下掉了,现在统一在tke环境上测试这部分内容。这个issue先关闭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bug

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions