Repository navigation
Description
Is there an existing issue for the same bug?
- Searched open and recently closed issues for
TestWatermarkBatchYieldsToRetirement,WatermarkBatch, watermark retirement, and watermark plustxn need retry in rc mode. No matching case/signature found. Closed [Bug]: Fulltext2 DROP DATABASE deadlocks with ISCP watermark flush in pessimistic BVT #31063 concerns DROP deadlocks, not this post-retirement RC retry assertion; [Bug]: ISCP timeout causes are reported immediately before timeout #29392 concerns timeout attribution.
Branch Name
PR #30316, codex/loom/develop/1ffa5784428cb25224175acaae3709b19809c81226d8ade686e4d13b57b6ef8c; official-main source comparison below.
Commit ID
PR head: b74a6810fe3541c6257fa205cb036ebbf222af60.
Current official main comparison: 28e8760905a7f39dba2ce436357ea75492f30512.
Other Environment Information
CI: Linux/amd64, Go 1.27.1, CGO enabled, -short -tags matrixone_test, no race, -covermode=set, 484 instrumented packages, package parallelism 8, test timeout 20m.
Local comparisons: Darwin/arm64, Go 1.27.1, CGO enabled, same tags/no-race and exact 484-package CI instrumentation list. Only the exact existing failing test was selected; package compilation parallelism 2, timeout 300s, three consecutive rounds per source. Each round starts the existing real two-CN embedded cluster. All six clusters released admission and port leases; test processes exited. These are not Linux CI reproductions.
Actual Behavior
Run https://github.com/matrixorigin/matrixone/actions/runs/40322151119, attempt 1:
- Root: UT Coverage job121569685121.
- Consequence: Coverage job121591814054: required producer incomplete; no coverage verdict calculated.
- Consequence: CI Required job121593415350:
matrixone-ut-coverage: failure.
Full failed-job logs and diagnostic artifact 12651645719, including the complete failed test output, were inspected. There are no build failures. The single failed test is:
TestWatermarkBatchYieldsToRetirement (4.48s)
watermark_contention_test.go:125
Received unexpected error: txn need retry in rc mode
The deliberately contested first flush returns the expected FastFail error and rolls back. Retirement commits both rows, and the test verifies no partial watermark update. The subsequent one-shot require.NoError(t, flush()) fails when updating table_id=3:
UPDATE watermark_contention.jobs
SET job_state=3, watermark='2-0',
job_status=JSON_SET(job_status,'$.LSN',6,'$.Stage',
GREATEST(CAST(COALESCE(JSON_UNQUOTE(JSON_EXTRACT(job_status,'$.Stage')),'0') AS SIGNED),1))
WHERE account_id=1 AND table_id=3 AND job_name='first'
AND job_id=1 AND job_state!=4 AND JSON_EXTRACT(job_status,'$.LSN')='5';Expected Behavior
The retirement contention test must distinguish its rollback/atomicity contract from a scheduling-sensitive RC snapshot retry on the later flush. Do not mask the result with arbitrary sleeps, ignored assertions or product changes in the formatting PR.
Steps to Reproduce
Run the existing pkg/iscp/TestWatermarkBatchYieldsToRetirement with the CI mode above, retaining all test assertions and its two-CN retirement/flush interleaving. The occurrence is intermittent; the recorded Linux coverage run fails, while ordinary Ubuntu UT in that same run passes.
Local command shape (the exact coverpkg list and expanded commands are retained in the repair task):
.agents/skills/mo-dev/scripts/mo-cgo-test -short -tags=matrixone_test -p=2 -v \
-count=3 -timeout=300s -covermode=set -coverprofile="$TMPDIR/control.cover" \
-coverpkg="$CI_484_PACKAGE_LIST" \
-run='^TestWatermarkBatchYieldsToRetirement$' ./pkg/iscpAdditional information
Four-part non-PR flaky-candidate evidence:
- Complete job logs and raw JSON/test diagnostics identify a runtime assertion on RC retry. This is not compilation, static/type/security failure, a coverage threshold failure, or a reproduced deterministic product error.
- Exact PR head passed three consecutive selected tests: 4.61s, 5.52s, 4.54s, terminal exit 0, no test skipped or assertion changed.
- Complete PR delta and the reachable failing SQL were checked.
pkg/iscp(test, batch owner, transaction creation, watermark writer and SQL builder), lockservice, lockop, andcompile/sql_executor.goare unchanged. The statement and fixture use integer JSON fields, integer keys/status and timestamp/string values; there is no FLOAT/DOUBLE conversion or historical float-bound catalog expression. The PR's shared JSON display paths preserve integer rendering; its added catalog migration skips trees without legacy float-to-string casts. It does not change RC refresh/retry, row-lock ordering, transaction snapshots, statement options or the test harness.iscp.getTxnstarts from the CN's latest applied logtail; lockop can request RC refresh, while the test's later flush is called only once. That is a plausible scheduling mechanism, not a claimed proven root-cause fix. Exact-head ordinary UT, SCA and both enabled BVT lanes also passed. - Identical exact test passed three consecutive rounds against clean current-main source: 5.64s, 5.73s, 4.59s, terminal exit 0. The managed lane forbids another checkout/worktree. A Go overlay therefore restores or hides every one of the 150 tracked differences between head and exact main, with replacement bytes individually verified against
git show 28e8760905a7f39dba2ce436357ea75492f30512:path. Module and native inputs match; Git HEAD and source files stay unchanged. Go1.27's cover invocation does not apply overlay paths to source inputs, so a task-local toolexec adapter translates only exact cover input filenames through that same verified map and invokes the original tool. It changes no source bytes, instrumentation policy, test or result. The initial unadapted main command failed at compilation and is excluded from test evidence.
Main passing is the expected result for this narrow flaky-candidate classification; it is not a claim of reproducing the Linux failure on main. The retained PR/main log SHA256 values are:
- PR:
89a55954a5161b0309a4929d2cacd24f809a498e382611209c1cf02a201a51ca - Main:
e1de29930dc887025fc6fba3edb70db9998b5a41b968904eed15bd6f2b0434d3
A single failed-jobs rerun of this exact run is planned after recording this issue. A repeated signature requires new comparison/attribution evidence; no unlimited reruns or changes to unrelated ISCP code are proposed.
Activity
XuPeng-SH commentedon Oct 26, 2026
Closing as fixed by merged PR #31288 (commit 24c1ac8, merged 2026-10-26T17:09:07Z).
Root cause: the test's single-attempt flush ran on a cross-CN snapshot that had not yet applied the peer's retirement commit, so the later flush hit an RC version conflict (txn need retry in rc mode) instead of committing. The fix fences the handoff (syncCommit via WaitLogTailAppliedAt) before the single-attempt flush and gates the probe on AffectedRows==1, removing the scheduling-sensitive window without sleeps.
Local verification on main @ 24c1ac8 (Darwin/arm64, Go 1.27.1): -count=3 -run '^TestWatermarkBatchYieldsToRetirement$' ./pkg/iscp, real two-CN embedded cluster per round, 3/3 passed (total 15s), terminal exit 0.
Final confirmation should come from the next UT Coverage run; the occurrence was intermittent.