Skip to content

[Bug]: CDC takeover lifecycle flakes when CN label RPC exceeds its three-second deadline #30231

Closed

Description

@iamlinjunhong

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Searched open and closed issues for debugUpdateCNLabel, TestCDCNoFullPublicTakeoverLifecycle, the test/deadline combination, and CN-label/timeout signatures. Closed #29375 concerns stale cross-CN checkpoint equality in this test, not this RPC timeout. Open #30209 concerns broadcast LoopJoin cancellation; #30205 concerns duplicate-reader watermark initialization. Neither covers this occurrence.

Branch Name

fix/mod-decimal-metadata-30157 (PR #30170); current official main control.

Commit ID

Exact failed PR head: 459b486985ffe5e1d30066d46340104635b95d5d.
Clean official main control: ddb76ea12cc05ac7517c026fa237516865f86c2b.

Other Environment Information

Original CI: Ubuntu/x86, Go 1.27.1, CGo, race detector, matrixone_test tag, short mode. Run 38576375970, attempt 1:

Local paired controls: Darwin/arm64, Go 1.27.1, supported repository CGo wrapper and verified matching native inputs. Both revisions retain race/tag/short settings. These controls do not establish Linux runtime equivalence or whole-suite stability.

Actual Behavior

The sole failed root test was TestCDCNoFullPublicTakeoverLifecycle, running from 16:36:20 to 16:37:37 UTC (77.83 seconds). After CN C starts, clearing CN B's labels fails:

ddl_test.go:1297 (called at ddl_test.go:1383)
Received unexpected error:
context deadline exceeded
internal error: debugUpdateCNLabel

The deferred CN B label cleanup at ddl_test.go:1163 also reports the same RPC deadline signature. CI Required then fails with Error: matrixone-ci: failure.

Source boundary: cluster.DebugUpdateCNLabel in pkg/clusterservice/cluster.go owns a fixed three-second context and calls managedHAKeeperClient.UpdateCNLabel, which forwards the RPC to Service.handleUpdateCNLabel and the HAKeeper store. This deadline is independent of the scenario's 240-second context. The failing call is DebugUpdateCNLabel(cnB.ServiceID(), empty labels) during real cross-CN ownership transfer, not a MOD expression evaluation.

The complete CI log also reports Raft proposal/checker-state timeouts and accumulated local tick batches during the failure. These observations support a progress/scheduling hypothesis; they do not independently prove runner infrastructure failure or a product root cause.

Expected Behavior

The real takeover scenario should complete its label updates and cleanup under the supported execution mode while preserving checkpoint/generation and cancellation assertions. Investigate the label-RPC/progress boundary and test synchronization; retain the failure signal and existing budgets during attribution.

Steps to Reproduce

Original CI entry:

make ut UT_CONFIGURED=1 UT_PARALLEL=6 UT_TIMEOUT=40 UT_SHARD=all

Paired diagnostic command, run serially on each revision:

.agents/skills/mo-dev/scripts/mo-cgo-test -race -short -tags matrixone_test \
  -p=1 -v -count=3 -timeout=15m \
  -run '^TestCDCNoFullPublicTakeoverLifecycle$' ./pkg/tests/sqlintegration

Additional information

Classification: non-PR flaky candidate under the four-part paired-control protocol; the Linux signature remains unreproduced locally and an underlying defect is not yet proved.

  1. The complete failed-job logs were downloaded and read. The failure is the finite label-RPC deadline above. No compilation/type/static/security failure, stable result mismatch, reported data race, or panic explains this run; only this root test failed.
  2. Exact PR head: all three consecutive selected tests passed with terminal exit 0: 51.41s, 48.97s, 73.98s.
  3. The full PR differential consists of seven MOD metadata/binder/resolver/test files. The failed test, CDC, HAKeeper/label-RPC implementation and fixture are unchanged. Shared binder/resolver source does change, but its new metadata path is guarded by MOD identity and does not execute for this RPC; it introduces no RPC/lifecycle owner. The takeover test closes the shared cluster before starting and closes its fresh generation afterward. In the actual CI sequence, it failed before the new MOD metadata test ran (16:37:53–16:37:56 UTC), excluding contamination by the new scenario. The later MOD test passed, as did exact-head SCA, UT Coverage and selected BVT lanes. Prior same-head full planner/function/42-test SQLintegration race suites and vet/lint also passed.
  4. Verified clean current official main: the identical command passed all three selected tests with terminal exit 0: 55.22s, 49.74s, 54.56s (package 162.737s). The failure did not reproduce in these bounded controls. The takeover test, fixture, CDC and label-RPC source are byte-identical between the revisions; native inputs are matching and the wrapper verified reuse from the lane. Main has other frontend/parser changes, so these results are not a claim of complete binary equivalence.

No source, assertion, timeout, sleep, retry policy, test selection or CI harness was changed to force a pass. After this evidence is published, request only one failed-jobs rerun of 38576375970 and verify its new attempt is accepted. A repeated failure requires renewed attribution rather than an automatic rerun loop.

Activity

  1. iamlinjunhong commented on Oct 16, 2026

    @iamlinjunhong
    ContributorAuthor

    Additional occurrence in PR #30325, exact head fdf5a8e9f5dfa963ea295697f5d15daab6e0a1b0 (CSV skipped-line metadata fix), run 38773408609 attempt 2:

    Both complete failed-job logs were read. The only failing root test is TestCDCNoFullPublicTakeoverLifecycle, 01:41:08–01:42:33 UTC, 84.71s. Its first failure is clearing CN B's labels after CN C starts:

    ddl_test.go:1298 (called at ddl_test.go:1384)
    Received unexpected error:
    context deadline exceeded
    internal error: debugUpdateCNLabel
    

    Deferred label cleanup at ddl_test.go:1164 reports the same deadline/cause. These are the same statements as the original occurrence's lines 1297/1383/1163, shifted by one line. DebugUpdateCNLabel at pkg/clusterservice/cluster.go:432 creates its own three-second context and calls UpdateCNLabel; the scenario's 240-second context has not expired at this 84.71-second failure. The complete log has Raft/checker-state timeouts and accumulated local-tick batches around the RPC error; this supports investigating progress/scheduling but is not proof of runner failure or an underlying product root cause. No build/type/static/security failure, race report or unhandled panic explains this run. CI Required fails as an aggregate consequence.

    Attribution uses the authorized known-open-issue comparison:

    1. This issue remains open, covers the exact case and context deadline exceeded plus debugUpdateCNLabel failure class, and contains repository-member analysis of the fixed three-second label-RPC boundary.
    2. Its independent Ubuntu/x86 occurrence is unrelated PR fix(plan): derive MOD decimal precision from original operands #30170, head 459b486985ffe5e1d30066d46340104635b95d5d, run 38576375970 attempt 1, job 115894578422. The job and run identity were rechecked through GitHub API and the original failure log was re-read.
    3. The complete current PR differential is five files: two scalar record-start assignments in CSVParser, parser/external-reader regression tests, and CSV SQL BVT coverage. None changes this test, CDC, CN-label/HAKeeper/logservice ownership, or the CI harness. The failed statement is a direct cluster-label RPC, without a CSV/external reader. No new global state, background work or RPC owner is introduced by the PR. Official main c46b893f6160902e74b3581fc968666cb9d07003 was independently verified; its recent changes to the same test file affect TestCDCNoFullPublicLifecycle, not this takeover test. Upstream harness changes are also outside this PR's differential.
    4. Retained unchanged exact-head evidence from attempt 1 for the PR's own closure passes: full csvparser/external tests locally and in CI, exact external_csv_comment.sql BVT 23/23 (zero ignored/failed/abnormal), SCA and both selected BVT lanes. These unchanged-head results remain valid; no product test is repeated merely for intake.

    This is a different failure from attempt 1's merge-scheduler query deadline tracked in #30336. No clean-main Linux reproduction is claimed, and no unrelated source/timeout/assertion/skip/retry policy is changed. After this new signature's evidence is recorded here, request one failed-jobs rerun from attempt 2; do not loop on a repeated signature without renewed attribution.

  2. XuPeng-SH commented on Oct 17, 2026

    @XuPeng-SH
    Contributor

    合并后独立实测(2026-10-17,冻结 main ba6b31941074cdaaf906ba2ec3883bc3b3eab85f,Linux/amd64、Go 1.27.1、匹配 make cgo 产物):

    完整 pkg/clusterservice 普通/race 各 37 个命名测试通过;legacy ctl consumer 普通/race 各 52 个通过。验证旧 API 固定 3 秒期限仍保留、新 API 原样转发有界 caller deadline,nil/无期限/取消/过期 context 在 RPC 前拒绝,及 RPC 错误传播对照。

    真实多 CN 的 TestCDCNoFullPublicTakeoverLifecycle,normal 19.34s、race 23.48s,均实际执行且 teardown 成功,保留 A→B→C 的 daemon claim 转移、checkpoint/generation、取消和清理断言。

    结论覆盖调用方 deadline 边界及本次真实接管回归;两次通过不等同长期 flake rate 保证,也不宣称所有 HAKeeper progress stall 或原始完整 CI 环境问题消失。

    原 issue 报告的 main 修复范围已验证,按约定转给 @Ariznawlll;新增独立问题继续由其单独 issue 跟踪。

  3. gouhongshen commented on Oct 21, 2026

    @gouhongshen
    Contributor

    Recurrence record after the #30337 bounded label API — workflow run 39629706962 attempt 1 (PR #30687)

    Workflow run 39629706962, attempt 1 (pull_request_target, checked-out PR head b6110b0a5b96bfc61d158ddd7487263da4c49fe4, GitHub-hosted Ubuntu/x86, Go 1.27.1, CGo; entry make ut UT_CONFIGURED=1 UT_PARALLEL=8 UT_TIMEOUT=40 UT_SHARD=all, short/race/matrixone_test mode) failed Matrixone CI execution / UT Test on Ubuntu/x86 and downstream CI Required on exactly one root test: TestCDCNoFullPublicTakeoverLifecycle (pkg/tests/sqlintegration), 16:45:18–16:46:11 UTC, 52.93s.

    Observed failure — the deferred CN C label cleanup, ddl_test.go:1325 (require.NoError(t, updateCNLabel(cnC.ServiceID(), map[string][]string{})); closure at ddl_test.go:1185 wraps DebugUpdateCNLabelWithContext — the #30337 API — with a 30 s context; the scenario's 240 s context had not expired):

    Error Trace: pkg/tests/sqlintegration/ddl_test.go:1325
    Error:       Received unexpected error:
                 timeout ... (dragonboat-wrapped logservice timeout)
    Test:        TestCDCNoFullPublicTakeoverLifecycle
    

    The failure second sits inside a logservice/HAKeeper progress-stall burst in the embedded multi-CN fixture: failed to check health / failed to get checker state / propose tick failed timeouts (logservice uuid 81105ecb), dragonboat had 45 LocalTick msgs in one batch / [00000:31072] had 46 LocalTick msgs in one batch, Wal-SLOW-LOG-Append latency 2.255s, tn.handle.commit.slow.log commit-latency 2.269s, commit txn too slow 2.269s, and error: timeout, converted to code 20429. In that window the runner cgroup was heavily CPU-throttled (job heartbeat at 16:45:35: cpu.max.quota=800000/100000 shared with 33 processes, nr_throttled=2282, throttled_usec=651745779, memory peak pinned at the 16 GiB cgroup limit). The older deferred CN B clear (registered at ddl_test.go:1191, runs after the 1325 closure) did not report a failure, i.e. the shard recovered within seconds — consistent with a transient stall, and with the scenario still succeeding everywhere else (checkpoint/generation/cancellation assertions all passed until this teardown deregistration).

    Why this is unrelated to PR #30687 (publication/subscription view-scope frontend fix):

    • PR delta base 7038c8520e5fc1ba456914b3c389ccedb69e22f7 → head b6110b0a5b touches only pkg/defines, pkg/frontend, pkg/sql/plan, and test/distributed/cases/publication_subscription; git diff is empty for pkg/tests, pkg/clusterservice, pkg/cdc, and pkg/logservice. No dependency or go.mod change.
    • The identical UT lane passed on the identical head ~90 minutes earlier: run 39599969113 attempt 2, job 119281940247 — steps.ut.conclusion: success, FAIL_UT_CASES= empty, with this same test in-session per the heartbeat (started 15:10:58 UTC) and pkg/tests/sqlintegration passing.
    • In the failed run itself, the PR's own suites (pkg/frontend, pkg/sql/plan race shards per heartbeat) and every other check were green: SCA, shared build, UT Coverage on Ubuntu/x86, multi-CN compose/proxy e2e BVT, and Coverage. FAIL_UT_CASES=TestCDCNoFullPublicTakeoverLifecycle, was the only entry.

    This matches the residual class the 2026-10-17 verification of the #30337 fix (frozen main ba6b31941074cdaaf906ba2ec3883bc3b3eab85f) explicitly left open: the bounded caller deadline removed the fixed 3 s deadline, while HAKeeper progress stalls under full-CI runner load were not claimed eliminated. No source, assertion, timeout, sleep, retry, or test selection was changed; per policy a single failed-jobs rerun of run 39629706962 was requested after this evidence was recorded.

  4. gouhongshen commented on Oct 22, 2026

    @gouhongshen
    Contributor

    Recurrence record — workflow run 39716108348 attempt 1 (PR #30769)

    Workflow run 39716108348, attempt 1 (pull_request_target, checked-out PR head 15f41231f5e778b150a45cbb686d86d927ab1a0d, GitHub-hosted Ubuntu/x86, Go 1.27.1, CGo) failed Matrixone CI execution / UT Test on Ubuntu/x86 and downstream CI Required on the root test TestCDCNoFullPublicTakeoverLifecycle (pkg/tests/sqlintegration), 04:08:44–04:10:02 UTC, 77.59s. (FAIL_UT_CASES=TestCDCNoFullPublicTakeoverLifecycle,TestPublicationSurvivesAllocatorRestart, also lists an earlier pkg/lockservice data-race failure at 03:35:20 UTC that is a different package and a different failure class; it has no matching existing issue and is not covered by this record.)

    Observed failure — the CN C label assignment, ddl_test.go:1325 (require.NoError(t, updateCNLabel(cnC.ServiceID(), map[string][]string{"account": {"sys"}})); the helper closure at ddl_test.go:1185 still wraps DebugUpdateCNLabelWithContext with a 30 s context, and the scenario's 240 s context had not expired):

    Error Trace: pkg/tests/sqlintegration/ddl_test.go:1325
                 pkg/tests/sqlintegration/ddl_test.go:1411
                 pkg/tests/sqlintegration/ddl_test.go:884
    Error:       Received unexpected error:
                 timeout ... (dragonboat-wrapped logservice timeout)
    

    The failure second sits inside another logservice/HAKeeper progress-stall burst in the embedded multi-CN fixture: 14× failed to send log service heartbeat (context deadline exceeded), 41× failed to get checker state (dragonboat timeout), repeated propose failed / propose tick failed timeouts, 40 dragonboat had N LocalTick msgs in one batch accumulations, error: timeout, converted to code 20429, and detector scans at ddl_test.go:1141 / ddl_test.go:1356 retrying with CDC test detector scan found no tables during the stall.

    Why this is unrelated to PR #30769 (DATA BRANCH DIFF output file-service lifetime fix):

    • PR delta base c232b6d2a1b5a94ac624c4954586569841c1e153 → head 15f41231f5e touches only pkg/frontend/data_branch_output.go and pkg/frontend/data_branch_output_test.go. git diff is empty for pkg/tests, pkg/clusterservice, pkg/cdc, pkg/logservice, and pkg/lockservice; no dependency or go.mod change.
    • The identical head passed this UT lane earlier the same day: run 39708823079 attempt 1, UT job 119595480840, success at 02:50:05Z.
    • In the failed run itself the PR's own suite was green (pkg/frontend pass, 246.65 s); the root failure above is a direct cluster-label RPC, without any DATA BRANCH DIFF / frontend output-file path.

    Same residual class the 2026-10-17 verification of the #30337 fix (and the 2026-10-21 recurrence record for PR #30687) explicitly left open: the bounded caller deadline removed the fixed 3 s boundary, while HAKeeper progress stalls under full-CI runner load were not claimed eliminated. No source, assertion, timeout, sleep, retry, or test selection was changed for this failure; per policy a single failed-jobs rerun of run 39716108348 was requested after this evidence was recorded.

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

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions