Skip to content

fix(disttae): bound long-transaction workspace maintenance and close orphan-cleanup ownership - #30988

Open
gouhongshen wants to merge 34 commits into
matrixorigin:mainfrom
gouhongshen:agent/issue-25590-6d5e84a3
Open

gouhongshen wants to merge 34 commits into
matrixorigin:mainfrom
gouhongshen:agent/issue-25590-6d5e84a3

Conversation

@gouhongshen

@gouhongshen gouhongshen commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Related to #25590

What this PR does / why we need it:

Long explicit transactions repeatedly updating the same primary-key rows rescan superseded workspace history at statement boundaries and during reads. This PR keeps incremental per-table views and compacts superseded entries so maintenance follows the live working set. The issue's UPDATE, REPLACE and DELETE+INSERT cases are covered by focused workspace tests and SQL cases.

Persistence and compaction also need a complete ownership contract: every unpublished object must reserve bounded capacity and remain owned until publication or cleanup. The implementation centralizes that contract in the workspace/engine, retains failed cleanup work, and drains it with bounded batches/backoff and a single shutdown budget. Local writers and remote fragments share the same same-version admission contract running on one build; remote ownership transfer proves the coordinator's intake adoption through the run's own batch-flow sequence/ack/drain barrier, installed in both stream modes (negotiated windowed and no-window alike), and clone-borrowed objects retain their existing owner. No per-feature protocol version, peer-capability gate or legacy fallback exists anywhere in the diff (the design document's r16/r17 records record that removal). Main's #26796 key-index/envelope ownership and Engine.Close shutdown ordering are preserved.

The versioned design carries the operative r17 design, the decision log, the per-round review records with their approval trace, and the per-invariant validation criteria (§7).

Delivered behavior

  • Workspace statement scaling — statement boundaries retire and compact superseded entries, per-table views follow the live working set, and rollback/commit recovery keeps the frontend's statement semantics intact.
  • Ownership and capacity — every persisted-but-unpublished object joins a fail-closed per-object admission bound at creation (insert sinkers, temporary data and tombstone writers, compaction rewriters, direct-S3 writers and the RC tombstone transfer), holds its unit until publication, transfer, or a proven deletion, and stays enumerable by exactly one owner at every instant; the aggregate obligation population stays pinned at the per-engine sums under sustained stalled deletion.
  • Settle and retire lifetimes — a proven deletion retires the ledger membership, the owning workspaces' per-claim capacity, and the transaction's recorded-name copy together; queued recorded names retire through the drain through a holder that never retains the completed transaction's graph; an accepted GC job holds its batch's capacity until the storage call proves the deletion, and a failed or unproven batch requeues losslessly to the bounded retry owner instead of settling.
  • Reuse and reset — writer Reset clears its failure-only staged slice; a reused delegate rebinds its persistent sinkers' capacity hook to the current workspace at Prepare and clears it at Reset, so no execution-scoped workspace reference outlives its transaction.
  • Remote fragments (same-version plane only) — the coordinator's intake adopts every relayed name through the same reservation before a clean run can settle; the adoption/drain barrier exists in both stream modes; a transferred settlement settles the ledger, keeps the adopted objects' recorded-name fate, and tears down the mirror's local workspace and segment claims; owner-scoped retirement keeps CN-wide segment-map scans out of fragment settlement.

Validation

Focused deterministic regressions cover each contract in its owning packages (pkg/vm/engine/disttae, pkg/sql/colexec with multi_update/insert/deletion, pkg/sql/compile, pkg/objectio/ioutil) and at the engine level (pkg/vm/engine/test), with -race legs for every synchronization-bearing change and counterexample-red/green proofs run during review. The context-blind deletion barrier's own failure path is pinned the same way: its release and bounded drain join run through the test's registered cleanup (idempotent against the explicit ordering-oracle release), and TestIssue25590DeleteGateCleanupReleasesParkedWorker proves the state a failing assertion leaves behind holds no parked worker. SQL-visible behavior is pinned by test/distributed/cases/dml/{update,delete,replace}_workspace.* and update_remote_fragment_capability.{sql,result}; every generated result was inspected against the intended semantics. The maintained per-invariant coverage spine and its criteria are recorded in the design document's §7.

Review and validation history

Each review round's finding, repair decision, and outcome is recorded in the design document's review records, with the compact approval trace in that document's header. This description previously carried the per-round execution chronicle as well; it was removed on 2026-10-30 after the delivery review's P2 on the same class in the design document (the repository's review contract excludes per-run evidence and review attestations from tracked delivery). The pre-cleanup design document and description are archived byte-identical outside the tracked repository with the loop controller; per-run CI evidence remains available through GitHub's run artifacts.

Known limitations

@mergify mergify Bot added the kind/bug Something isn't working label Oct 23, 2026
@matrix-meow matrix-meow added the size/XXL Denotes a PR that changes 2000+ lines label Oct 23, 2026
@gouhongshen
gouhongshen force-pushed the agent/issue-25590-6d5e84a3 branch from 06c583c to a1aefd5 Compare October 23, 2026 17:23
gouhongshen added a commit to gouhongshen/matrixone that referenced this pull request Oct 23, 2026
…iles

The SCA license job of run 39994645622 failed on this PR: license-eye
reported 12 files added by PR matrixorigin#30988 without a valid Apache-2.0 header.
Nine files (the relay/admission sources, their tests and
txn_issue25590_test.go) carried no header at all; the three r33/r34
disttae tests carried a header with a noncanonical license URL
(http://www.apache.org/licenses-2.0 instead of .../LICENSE-2.0), one
also reflowing the "either express or implied" clause.

All 12 now carry the repository's canonical Matrix Origin Apache-2.0
header, byte-identical to sibling table_meta_reader_r32_test.go which
passes the same check.

Verified with the pinned CI tool (license-eye v0.4.0): the header
check over the 12 files reproduces the CI failure on the pre-fix head
(12 invalid, exit 1) and passes after the fix (12 valid, exit 0); the
full-tree header check reports 0 invalid files (exit 0). Comment-only
change: gofmt -l and parse checks over the 12 files are clean.
@XuPeng-SH

XuPeng-SH commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 19358d2881c0cf83e0d7784ceea20ec767539356

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 19358d2881c0cf83e0d7784ceea20ec767539356

Assessment: request_changes

One capacity-bound integration defect remains in RC tombstone transfer. Earlier lifecycle findings are resolved in the current source; 12 focused regressions passed.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1

  • P2 pkg/vm/engine/disttae/txn.go:3914: An RC transaction transfers persisted tombstones while the engine's unpublished-object capacity is full. TransferFlow.fillDefaults creates its sinker without the reservation hook, so transferTombstoneObjects persists replacements before reaching this record gate.
    Impact: Recording rejects the replacement, but this fallback retains it beyond the configured bound. Further transfers can grow the backlog despite admission refusal. Bind the transfer sinker to the workspace's reservation and cleanup lifecycle before persistence, and add a saturation regression.
    Evidence: transfer_util.go:224 constructs the unhooked sinker; transfer.go:111 persists before recording at line 144. The internal producer/gate probe observed retained=2 with limit=1 and a physical replacement file. The same producer with SinkerCapacityOption refused before persistence. See transfer-probe-runtime.log and checks/1793253799150507913-3.json.

Validation:

  • Isolation preflight and native prerequisite build passed; 193 frozen native inputs were verified.

  • 12 focused lifecycle regressions passed: lifecycle-regressions.log, checks/1793253875329094165-3.json.

  • The capacity probe failed its invariant assertion; its hooked control passed. Initial fixture and linker setup failures are retained separately.

  • Final audit verified unchanged source, matching patch content after newline normalization, receipts, and coverage of all 62 discussion keys: validation-audit.json, checks/1793254057811392189-4.json.

Limitations:

  • The probe exercises the transfer producer and record gate internally; RC rowid lookup and an end-to-end SQL reproduction were not executed.

  • Full SQL, performance, race, and exhaustive test/document-history review were deferred after the integration blocker converged.

ConstructCNTombstoneObjectsTransferFlow built its sinker without the
workspace's per-object admission hook, so the RC transfer persisted
replacement tombstones before the DELETE record reached the choke: at
a saturated bound the refused record fail-open-retained every
persisted name and further transfers kept growing the retained
backlog. The flow now constructs its sinker with the owning
transaction's SinkerCapacityOption, so each replacement reserves one
in-flight unit before it goes durable, saturation refuses the
transfer with nothing half-persisted, the record converts the
reservation, and an interrupted transfer settles through the existing
statement-rollback/terminal reservation drains.

issue matrixorigin#25590 round-59 review (P2 at pkg/vm/engine/disttae/txn.go:3914)
@gouhongshen

Copy link
Copy Markdown
Contributor Author

Fixed at pushed head a52b906996 — the round-59 review's RC-transfer admission finding (P2 at pkg/vm/engine/disttae/txn.go:3914).

Verified valid, exactly as your probe observed: ConstructCNTombstoneObjectsTransferFlow built the transfer's tombstone sinker without the workspace's per-object admission hook, so transferTombstoneObjects persisted each replacement at flow.Process before the DELETE record reached the register choke — the names arrived reservation-less, and at a saturated bound the refused record fail-open-retained every physically persisted name; further transfers kept growing the retained backlog despite the refusal (your retained=2 behind limit=1 with a physical replacement file).

Fix (one option argument through the existing TransferOption plumbing — no protocol, policy or ownership change anywhere else):

  • TransferFlow gains sinkerOpts + WithTransferSinkerOption; fillDefaults constructs the default tombstone sinker with those options appended;
  • ConstructCNTombstoneObjectsTransferFlow passes txn.SinkerCapacityOption() — the same binding rewriteObjectByDeletion and every S3 writer already carry: each replacement reserves one in-flight unit before it goes durable, a saturated ledger refuses the transfer with nothing half-persisted, the record below converts the reservation (reserved names never reach the fresh/refuse class), and a transfer interrupted between spill and record settles through the same statement-rollback/terminal reservation drains as every other reservation producer.

Saturation regression: TestIssue25590RCTombstoneTransferBoundToTheAdmissionLedger (pkg/vm/engine/disttae/txn_issue25590_r59_test.go):

  1. pre-fix leg — the unhooked producer (the construction fillDefaults still allows) reproduces your exact verdict through the production record route: persists first, record refused at the bound, fail-open retain books the name, live=2 behind a one-unit bound with both physical files durable;
  2. refusal leg — the production wiring refuses each saturated transfer before persistence: three repeated rounds persist nothing, book no in-flight unit, retain nothing new — the backlog cannot grow despite admission refusal;
  3. lifecycle leg — under the restored bound the hooked transfer reserves (inFlight=1, name on the transaction's reservation map), and the record converts the reservation;
  4. interrupted leg — a never-recorded transfer settles through the terminal reservation drain to a reachable cleanup owner, and the queue handoff deletes the physical file.

Validation: the focused four-leg regression passes (/tmp/r59logs/r59_focused.log, ok 1.766s, exit 0); the full disttae TestIssue25590 corpus plus all TestTransfer*/TestTombstoneTransfer*/TestDeletedObjectFilter* cases passes (/tmp/r59logs/r59_final.log, ok 55.144s, exit 0); go vet clean (r59_vet.log); golangci-lint run --new-from-rev HEAD reports 0 issues (r59_lint.log); gofmt clean. The PR description's new Round 60 section records the full change, and the earlier lifecycle finding list stays addressed by the same head.

@gouhongshen gouhongshen left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex automated review

Replacement review at the new head a52b906 (one authored commit over the previously reviewed 19358d2; no merge commits in the increment). The complete new review surface since the previously reconciled head 7c75f3e is nine files: the round-58 gcAccepted fix (unchanged here), the test-only round-59 CI-recovery commit, and this increment (transfer_util.go +50/-6 plus one new 343-line regression file). Disposition of every prior blocker at this head: my round-58 P2 — compaction-superseded objects releasing admission capacity at commit while their accepted GC deletion was in flight — is fixed and re-verified (the engine-owned, name-keyed gcAccepted refcount's four transitions at types.go:1474/txn.go:1906/txn.go:2087/types.go:1529 are byte-identical in this increment). The mo-bot RC-transfer P2 raised at 19358d2 — the transfer's sinker built without the workspace admission hook so replacements persisted before the record gate and refused records fail-open-retained names beyond the bound — is addressed by this increment, and I independently verified the fix: ConstructCNTombstoneObjectsTransferFlow now passes txn.SinkerCapacityOption() through the new WithTransferSinkerOption, so fillDefaults constructs the default tombstone sinker with the pre-existing per-object admission hook; each replacement reserves one in-flight unit before it goes durable, a saturated ledger refuses the transfer with nothing half-persisted, the DELETE record converts the reservation into recorded ownership through the existing register choke, and a transfer interrupted between spill and record settles through the statement-rollback and terminal reservation drains with the physical file collected by the handoff and the queue delete. The default construction for other flows is unchanged (empty sinkerOpts), the flow is constructed fresh per table pass under the transaction lock so there is no persistent-sinker rebinding hazard, and the reservation machinery is the already-reviewed round-18/19/22/33 lifecycle. Earlier topics — rounds 1 through 57, aunjgr's transferred-fragment teardown P1 fixed at e2653d7, the round-57 per-workspace claim sets, and fengttt's approval as decision context — are fixed at prior heads and untouched by this increment. The four-leg regression TestIssue25590RCTombstoneTransferBoundToTheAdmissionLedger pins the pre-fix overshoot (retained=2 behind a one-unit bound with physical files), the saturated refusal across three rounds, the reserve/convert lifecycle, and the interrupted window; every fixture it references exists, and gofmt is clean on the changed files. Limitation: focused tests cannot be executed in this checkout because the documented build requires the thirdparties/install CGO headers (xxhash, roaring, usearch, jemalloc), which are absent, and the review constraints forbid installing dependencies; the package build fails at those headers identically on a pristine pre-change tree, so the failure is not attributed to this PR. Verification is therefore full-source analysis of the increment with complete history reconciliation, corroborated by the author's recorded focused and corpus runs (r59_focused.log, r59_final.log, vet and lint clean) and the earlier rounds' passing regression evidence. Conclusion: every blocking topic from the review history is fixed at this head, the increment correctly closes the last open finding without introducing any new defect, and no findings remain.

@XuPeng-SH

XuPeng-SH commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · superseded

Commit: a52b906996de1ab837d228a79ee4ca1c28350ade

Review linked issue or PR description changed before publication; a fresh contextual review is queued.

@XuPeng-SH

XuPeng-SH commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · superseded

Commit: a52b906996de1ab837d228a79ee4ca1c28350ade

Review belongs to an older commit; it is not a review of the current head.

@aunjgr aunjgr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes. The previously reported successful-transfer workspace leak is fixed: the transfer now calls delTransaction and the new tests cover mpool/segment retirement. I found one remaining failure-path violation of the approved lossless-cleanup invariant in the updated GC ownership path. Passing CI was observed; this finding is based on source and the deletion helper, not a separately run fault-injection test.

Comment thread pkg/vm/engine/disttae/types.go Resolved
The round-60 review of PR matrixorigin#30988 head a52b906 (GC ownership path)
found the accepted GC worker settling on an unproven deletion:
DeleteUnpublishedObjects stops at its own first failing storage
sub-batch and proves nothing about the rest, but the worker logged the
error and then unconditionally retired the whole batch's ledger
membership (the admission capacity and the r58 engine-owned claim) and
the submitter's recorded-name copy - so on a storage outage the
objects could still exist with the last enumerable owner dropped, and
nothing would ever retry the lost names, violating the lossless
ownership this PR's ledger promises (design I2).

The failed batch now transfers to the engine's bounded retry queue in
one queue-mutex section (requeueFailedGCUnpublishedPending): the batch's
engine-owned gcAccepted references release inside the section, each
name's owned membership moves whole into the queue's own slot (the
capacity unit is held, never freed), and the recorded-name holder the
worker captured registers per name so the queue's settle retires the
recorded copy exactly at a proven deletion or not-found. Because that
registration must survive a transaction that may already have ended,
recordedOwners is re-keyed from *Transaction to the
*txnRecordedUnpublished holder (the drain's retire needs only the
holder; no queued obligation may retain a completed transaction's
graph - round-40/41). Recovery is the existing drain ladder behind
the GC tick; a name the failed call had already deleted returns
not-found - the documented success - on the next retry.

Regressions (all three red on the previous head exactly at this
contract, green on the fix; logs under /tmp/issue25590-r60/):

- TestIssue25590AcceptedGCWorkerFailureRequeuesObligationUntilProof:
  the review's whole-batch scenario - accepted worker fails, both
  names requeue with capacity held and recorded copies tracked; the
  recovery drain deletes both and retires ledger, copies and bound per
  name at proof.
- TestIssue25590AcceptedGCWorkerMidBatchFailureRequeuesWholeBatch:
  the LocalFS partial-batch shape - the failing call's first file is
  already gone, the whole batch requeues, the retry tolerates the
  absent prefix and settles every name per file.
- TestIssue25590FailedGCBatchObligationSurvivesTerminalWithoutRe
  tainingTxn: commit while the failed names sit queued - the
  obligation survives the terminal, owner entries detach with the
  recorded copies, the emptied holder settles nothing and the drain
  still proves the deletions.

Design: the round-60 record in docs/design/20261021-issue-25590-
workspace-scaling-and-cleanup-ownership.md (implementation follow-up
inside the approved design; settle classes keep whole-membership
retirement on proofs only).
The UT Coverage lane of run 40918631620 failed TestGCFiles with ants'
ErrPoolOverload at the test's own park submit (workspace_test.go:2547):
an engine-owned submitter - the failed accepted delete's requeue tail
scheduling a background queue drain into the pool current at that
instant - took the freshly reset 1-worker nonblocking pool's worker
inside the window between ResetGCWorkerPool and the park Submit.

The engine never promises an idle pool: the requeue tail, the
enqueue-side drain and the one-minute GC scheduler tick all submit into
whatever pool is current, asynchronously. The test now parks the
worker on a pool the engine has not seen yet, so no engine submitter
can race the park; after the handoff every engine submit faces a busy
nonblocking pool and transfers its names to the queue losslessly per
design.

The two rounds are now told apart by distinct name classes:
- round 0 uses parseable-but-missing names: the accepted submission's
  delete returns the not-found proof, settles and retires every claim,
  so the queue stays empty at every instant (the old require.Empty
  raced the failed worker's requeue of the unparseable zero names);
- round 1 uses '#' poisoned names that path validation refuses
  forever, proving the refused-submission handoff and the drain-pass
  retention with distinguishable names (the old three names all
  rendered the identical zero string, so a partial tail passed
  undetected).

ResetGCWorkerPool's worker join becomes the phase barrier: round 1
asserts an empty queue with zero live claims before any refused-round
assertion, and the index-range GC now hands over exactly the round's
own recorded write window.
@XuPeng-SH

XuPeng-SH commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · superseded

Commit: 921be87c932825c4d30dff0af7b0dfcbeb2aefa6

Review discussion changed before publication; a fresh contextual review is queued.

@gouhongshen gouhongshen left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex automated review

Reviewed head 921be87 against origin/main; the new surface since the previously reviewed head b13f6ff is a single test-only commit (pkg/vm/engine/test/workspace_test.go, TestGCFiles), with no merge commits in the range. Disposition of prior blocking topics: the mo-bot RC-transfer P2 raised at 19358d remains fixed at a52b906 and its files are untouched by this increment; the round-57/58 capacity and workspace-claim topics remain fixed; aunjgr's earlier remoterunServer P1 remains fixed at e2653d7 as he confirmed himself; and the one outstanding third-party verdict, aunjgr's CHANGES_REQUESTED at types.go:1508 (accepted GC worker settling on an unproven deletion), is fixed at b13f6ff, which I re-verified at this head: a failed DeleteUnpublishedObjects no longer settles; the whole batch transfers to the engine's bounded retry queue in one queue-mutex section, the capacity unit is held through the outage, settle happens only at proven deletion or not-found, recordedOwners is re-keyed to the txnRecordedUnpublished holder so a completed transaction's graph cannot be retained, and three r60 regressions pin the whole-batch, mid-batch-prefix, and terminal cases. The new test commit correctly closes the CI flake from run 40918631620: the worker is now parked before ResetGCWorkerPool hands the pool to the engine, so no engine submitter (requeue-tail drain, enqueue-side drain, one-minute GC tick) can take the fresh pool's only worker in the reset-to-park window; after handoff every engine submit faces a busy nonblocking pool and transfers names losslessly to the queue. I verified each premise from source: round-0 names are path-valid and LocalFS deleteSingle returns nil for an absent file (the not-found proof), so the accepted round settles deterministically and the queue stays empty; round-1 names end in '#', which fileservice's validatePath whitelist refuses forever, so the drain pass retains exactly the queued names and reports the storage error; ResetGCWorkerPool's ants ReleaseContext joins old workers, making the new phase-barrier assertions deterministic; the default engine GC pool is a 5-worker blocking pool so round-0 submissions are accepted; the per-round index-range windows match the one-entries-per-WriteFile layout of txn.writes; and the 42-byte name-window construction is distinct per round, guarded by an explicit require.Len. Focused tests could not be built in this checkout because the documented build requires thirdparties CGO headers (xxhash, roaring, usearch, jemalloc) that are absent and the review constraints forbid installing them; the failure is environment-only and identical on a pristine tree. Static verification that did run: gofmt is clean on the changed files and 'go build ./pkg/vm/engine/disttae/' compiles. CI at this head passed the UT Coverage lane (the previously failing lane), UT Test, shared build, and BVT/e2e lanes. Every blocker from my own prior reviews is fixed and verified, the remaining third-party review state is answered by a fix I independently validated, and the new increment introduces no defect; no blocking or non-blocking findings remain.

@XuPeng-SH

XuPeng-SH commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 921be87c932825c4d30dff0af7b0dfcbeb2aefa6

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 921be87c932825c4d30dff0af7b0dfcbeb2aefa6

Assessment: request_changes

Prior runtime concerns are resolved. One repository-required delivery cleanup remains; the latest approval does not address this artifact requirement.

Model: gpt-6-astra / xhigh

Session: 01a1869d-820c-7212-9788-aecfb86a4141 · slot 0 · generation 2

  • P2 docs/design/20261021-issue-25590-workspace-scaling-and-cleanup-ownership.md:4657: The committed design includes extensive per-run CI/review narratives, although the preexisting repository review contract explicitly excludes review attestations and one-off proof narratives from tracked delivery.
    Impact: Obsolete test-run details and transient evidence become maintained documentation, obscuring the operative design and violating the delivery-artifact requirement. This is a policy finding, not a demonstrated runtime failure.
    Evidence: .agents/skills/mo-self-review/SKILL.md:65–74 establishes the requirement at both base and head. This section records CI jobs, reproduction results and /tmp logs for removed receiver-refusal/R15 tests. Remove or externally archive that chronology while retaining the current design, substantive decisions and compact approval trace.

Validation:

  • Static audit passed: checks/1793304223628960872-4.json matches review-audit.log and the clean frozen head.

  • All 74 discussion entries accounted for in discussion-assessment.json.

  • Reconciled current-head CI successes and supplied author validation; details retained in review-evidence.json.

Limitations:

  • No new Go tests were run for this source-established delivery finding.

  • CI status metadata and author reports were available; their raw execution logs were not supplied.

@aunjgr aunjgr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My earlier failed-delete ownership finding is fixed: failed accepted batches now transfer to the retry queue without releasing capacity. One required delivery-artifact cleanup remains.

@XuPeng-SH

XuPeng-SH commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 921be87c932825c4d30dff0af7b0dfcbeb2aefa6

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 921be87c932825c4d30dff0af7b0dfcbeb2aefa6

Assessment: request_changes

The failed-delete ownership fix is present. The existing delivery-artifact finding remains; runtime approval does not resolve that requirement.

Model: gpt-6-astra / xhigh

Session: 01a1869d-999c-7481-b340-ae4a63e8cee4 · slot 1 · generation 2

  • P2 docs/design/20261021-issue-25590-workspace-scaling-and-cleanup-ownership.md:4657: The committed design retains extensive per-run CI and review narratives, including a removed receiver-refusal test.
    Impact: This violates the repository’s delivery-artifact requirement and obscures the operative design. Externalize transient chronology while retaining current invariants, meaningful decisions and a compact approval trace.
    Evidence: .agents/skills/mo-self-review/SKILL.md:65–74 excludes review attestations and one-off proof narratives; the rule is identical at base and head. The CI records beginning at lines 4657 and 4718 remain. This confirms the existing policy finding, not a runtime defect.

Validation:

  • Static audit passed: checks/1793357253562126284-2.json matches review-audit.log and the clean frozen head.

  • All 78 discussion keys accounted for exactly once in discussion-assessment.json.

  • Reconciled current-head successful UT, SCA, coverage and multi-CN BVT metadata; receipt and log details retained in validation-ledger.json.

Limitations:

  • This contextual follow-up reused supplied same-head runtime coverage; no new Go tests or exhaustive runtime audit were performed.

  • Raw CI and author execution logs were not supplied.

…ed design record

The 2026-10-30 delivery review of PR matrixorigin#30988 (P2 at the r15 record)
enforced the repository's delivery-artifact contract
(.agents/skills/mo-self-review/SKILL.md): per-run CI/review evidence -
CI run and job identities, local reproduction log narrations, per-head
red/green execution records and review attestations - is excluded from
tracked delivery.

The operative design text (§1-§9), every revision's findings,
decisions and supersessions, and the compact approval trace are
retained unchanged; each implementation round keeps its finding, its
trigger analysis, its decision and its maintained regression coverage,
and now references the executed evidence through the external archive
and GitHub's CI artifacts. The complete pre-maintenance document is
preserved byte-identical outside the tracked repository with the loop
controller (snapshot at head 921be87, sha256
5276bf5f6da64802189ac7cfbd3b38830816d3752212a3fc69dd122c9e165e70).

No design decision, invariant, or validation requirement changes.
@gouhongshen

Copy link
Copy Markdown
Contributor Author

@XuPeng-SH — delivery-cleanup round (P2 at docs/design/20261021-issue-25590-workspace-scaling-and-cleanup-ownership.md:4657): verified valid and in scope, fixed at pushed head c7b40fabac ("docs(design): move the per-round execution chronicle out of the tracked design record").

Your finding re-checked against the contract first: .agents/skills/mo-self-review/SKILL.md:65–74 excludes raw logs, per-run manifests, review attestations and one-off proof narratives from tracked delivery, and keep raw evidence in CI artifacts/external links. The committed design document carried exactly that chronicle — the cited r15 section's CI ROUND RECORD / SECOND FOLLOW-UP / MERGE RENUMBER RECORD blocks narrated CI runs 40257231611 and 40267988027, job identities, three-topology local launches and /tmp/issue25590-* logs for the receiver-refusal/R15 tests that Revision r16 had already removed wholesale — and the surrounding round records carried the same class (per-head introductions, /tmp validation logs, red/green execution narrations, CI-run triage chronicle).

Disposition at c7b40fabac (docs-only; no Go byte changed, no design decision, invariant or validation requirement changed):

  • Removed the per-round execution chronicle in full: every /tmp/… reference, local run/job identity, per-head introduction and red-green execution narration; §7's per-run CI counts; the round-45 r15 record's implementation/CI/renumber chronicle; the rounds 49/54–60 validation-ladder narrations; the round-59 CI-triage chronicle. Post-edit audit: zero /tmp references, zero transient CI run/job identities, zero mo-bot job ids remain (the retained CI run 40395203882 approval-evidence identity and the probe's recorded exit 1 observation are the design-gate trace identities, cited for reproducibility of the recorded approvals).
  • Retained the operative design §1–§9, each revision's findings/decisions/supersessions, every round's finding + trigger analysis + decision + deliberately-unchanged contracts + the maintained regressions with their asserted contracts, the design-checkpoint records with their reviewed-revision sha256/approval identities, and the compact approval trace (header Status + §10 records). Section-header structure is unchanged.
  • External archive: the complete pre-maintenance document is preserved byte-identical outside the tracked repository with the loop controller — state/artifacts/issue-25590/design-chronicle-pre-cleanup-921be87c93.md, sha256 5276bf5f6da64802189ac7cfbd3b38830816d3752212a3fc69dd122c9e165e70 — and the design document's header records that archive identity; per-run CI evidence also remains available on the GitHub runs themselves.
  • The PR description carried the same chronicle class (round-by-round experiment narratives, log-file names, per-head red/green sections), so it was compacted in the same push to problem / resulting behavior / validation / known limits, with the pre-maintenance description archived alongside (state/artifacts/issue-25590/pr-body-pre-cleanup-20261030.md, sha256 134f7493bf07532dba68115780c3883d8c679fc60bfa51cc29a045fec368ed03); design-record citations in review threads remain the per-round trace.

Static verification for the artifact requirement: the diff is the single design document (332 insertions/885 deletions at review time; LF-only, no trailing whitespace or tabs), the PR head moved 921be87c93 → c7b40fabac, and the fresh CI runs of the new head will re-evaluate the "Documentation whitespace check" and the rest of the lanes.

@gouhongshen

Copy link
Copy Markdown
Contributor Author

@aunjgr — thanks for both confirmations. You verified at head 921be87c93 that the failed-delete ownership fix is present (failed accepted batches now transfer to the retry queue without releasing capacity), and that the one remaining blocker is the delivery-artifact cleanup — the same P2 the mo-bot review cited at docs/design/20261021-issue-25590-workspace-scaling-and-cleanup-ownership.md:4657.

That cleanup is delivered at the freshly pushed head c7b40fabac ("docs(design): move the per-round execution chronicle out of the tracked design record", docs-only, no Go byte changed):

  • The per-run execution chronicle is removed from the tracked design document in full (the r15 CI ROUND RECORD blocks you both cited, every /tmp log reference, local CI run/job identity, per-head red/green narration, and the same class across the round records).
  • Retained: the operative design §1–§9, every revision's findings/decisions/supersessions, each implementation round's finding + trigger analysis + decision + maintained regression coverage, the checkpoint approval identities, and the compact approval trace.
  • The complete pre-maintenance document is archived byte-identical outside the tracked repository with the loop controller (state/artifacts/issue-25590/design-chronicle-pre-cleanup-921be87c93.md, sha256 5276bf5f6da64802189ac7cfbd3b38830816d3752212a3fc69dd122c9e165e70), and the PR description — which carried the same chronicle class — was compacted to problem / resulting behavior / validation / known limits in the same push.

The full disposition (with the post-edit audit: zero /tmp or transient CI-identity references remain) is in the reply to the mo-bot review below. Re-review at the new head whenever you're ready.

@XuPeng-SH

XuPeng-SH commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: c7b40fabac7bef97c517f2323601328ced3256c0

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: c7b40fabac7bef97c517f2323601328ced3256c0

Assessment: approve

Prior ownership, capacity, cleanup and lifecycle findings are resolved. The documentation cleanup closes the remaining delivery concern. No actionable unresolved findings remain.

Model: gpt-6-astra / xhigh

Session: 01a1869d-820c-7212-9788-aecfb86a4141 · slot 0 · generation 2

Validation:

  • Reviewed affected ownership paths, failure recovery, remote settlement, regression oracles and all 84 discussion entries; saved discussion-assessment.json.

  • Static audit passed: 73 changed paths and 191 hunks match frozen sources; source remains clean; 64 Go files pass gofmt parsing/format checks; new single-row SQL expectations match independent transaction arithmetic.

  • Receipt checks/1793503442746065635-3.json reconciled with review-audit.log and validation-reconciliation.json.

  • Frozen CI metadata reports successful build, UT, coverage, static analysis and two multi-CN BVT lanes.

Limitations:

  • No local Go tests, race tests, BVT or benchmarks were run. Raw CI and author execution logs were not supplied.

  • The documented crash-mid-queue orphan limitation remains within the accepted design scope.

@aunjgr aunjgr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous accepted-worker deletion failure is now routed into the retry owner without falsely settling capacity. I traced the current queue/reservation/recorded-holder ownership, statement-boundary staging and remote adoption/ACK settlement paths. One verified failure-path test cleanup blocker remains inline. This review does not claim a new local runtime/race run or a complete fresh implementation PASS; green CI and the supplied validation are reused.

@XuPeng-SH

XuPeng-SH commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: c7b40fabac7bef97c517f2323601328ced3256c0

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: c7b40fabac7bef97c517f2323601328ced3256c0

Assessment: request_changes

New discussion changes the prior approval: one P2 test-cleanup defect is confirmed. Previously resolved production and design concerns remain closed.

Model: gpt-6-astra / xhigh

Session: 01a1869d-820c-7212-9788-aecfb86a4141 · slot 0 · generation 2

  • P2 pkg/vm/engine/disttae/txn_issue25590_test.go:2339: After Rollback schedules orphan cleanup, a fatal assertion at lines 2344–2351 exits the test before closeDeleteGate runs.
    Impact: The drain worker can remain blocked indefinitely, retaining fixture state beyond teardown. Pool release and context cancellation cannot unblock the private channel receive.
    Evidence: Delete waits at line 1604 on <-gate without cancellation; the sole release is at line 2354, with no registered fallback cleanup. This confirms review_comments:4440766469 and violates the repository's assertion-failure cleanup contract. Register an idempotent release immediately and boundedly join the drain before pool/file-service teardown.

Validation:

  • Read and classified all 88 discussion entries; saved discussion-assessment.json.

  • Static audit confirmed the frozen head, unchanged source, matching patch and failure-path control flow: checks/1793613230783136383-3.json and review-audit.log.

  • Receipt, log and artifact reconciliation passed: checks/1793613275218976177-4.json and validation-reconciliation.json.

Limitations:

  • No new Go, race or BVT tests ran; the finding is established by source analysis.

  • Reused review 5726235176 for unchanged coverage. Its original artifacts and raw CI/author logs were unavailable; supplied CI successes are status metadata only.

…d cleanup

TestIssue25590RollbackHandsOrphanCleanupToEngineGC released its gated,
context-blind Delete only through the body's explicit call after the
synchronous assertions, so a failing require exited through FailNow and
leaked the parked GC worker and the fixture's storage - pool.Release
cannot end a channel wait. gateDeletesAfter now closes through a
sync.Once (idempotent, matching armDeleteBlock/armDeleteIgnoreCtxBlock),
issue25590RegisterDeleteGateRelease registers the release immediately
at the arming - t.Cleanup runs it first, ahead of the pool and fixture
teardown, and joins the engine queue's drain boundedly after the
release - and the explicit body release stays the ordering oracle. The
new TestIssue25590DeleteGateCleanupReleasesParkedWorker ends its body
at exactly the FailNow state so a teardown-order witness pins the
failure path red/green; the round-62 design record carries the trail.
@gouhongshen

gouhongshen commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Combined disposition for the two mo-bot-local request-changes findings on the record — correction of this comment's first draft, which mislabeled their sources; the evidence content stands, with each item now attached to its actual review:

(a) The 2026-11-02T09:55:22Z review (review id 5734755552, generation 2, head c7b40fabac) requests changes for exactly one P2: pkg/vm/engine/disttae/txn_issue25590_test.go:2339 — the context-blind deletion barrier released only by the body's explicit call, so a failing require past the arming exits through FailNow and the drain worker stays parked at <-gate (confirming aunjgr's review_comments:4440766469). Fixed at fce13c950c exactly as the review prescribes: gateDeletesAfter now closes through a sync.Once (idempotent release), issue25590RegisterDeleteGateRelease registers the release immediately at the arming so t.Cleanup runs it FIRST — ahead of pool/file-service teardown — and after the release it joins the engine queue's drain bounded (5 s), and TestIssue25590DeleteGateCleanupReleasesParkedWorker proves the FailNow state red/green: with the registration stripped, only the new witness fails (0 delete calls after teardown, want 1); on the fixed tree all three affected tests pass, also under -race; vet/gofmt clean. The confirmed thread PRRT_kwDOFEPiGM6ymrwT is resolved with the fix record, and the round-62 design record in the tracked document carries the full trail.

(b) The r11/r12 approval-traceability request_changes belongs to the mo-bot's generation-1 review of 2026-10-23T21:12:35Z (frozen head 9694277ba9ce13c002cb26063f0fb7cf6b2fc695) — 10 days and several recorded design approvals ago, already superseded by the mo-bot's own per-head lineage (including its APPROVED of 2026-11-01T03:25:07Z on the pre-fix head c7b40fabac). It does not apply to this PR's current line; for completeness, the supersession evidence on the current head:

1. The generation-1 frozen head is disconnected, pre-rebase. 9694277ba9 ("test(disttae): align TestGCFiles with the lossless pool-overload GC handoff") is not an ancestor of the current PR branch (git merge-base --is-ancestor 9694277ba9 <head> exits 1; the commit is reachable only from a local round-36-era backup ref, and no branch containing it includes the PR head). The review's "55 changed files" inventory is the diff of that orphan line; this PR's change against its actual base merge-base 3cf38889bca2 is 73 files (64 Go). Its line references target the document as of that orphan head.

2. The specific P2 text it quotes was mid-flight state, long superseded. At the frozen head, doc lines 2678–2681 carry "r11 is submitted for independent design review; this handler does not self-approve the design gate, and implementation proceeds only after the reviewer's PASS on r11." At the current head, the same subjects carry the recorded outcomes instead:

  • Header approval trace: "PASS at r11 by the round-27 independent design-only review of 2026-10-22 (reviewed content sha256 74edf0d9ba9c2e1711467ef718b08f76b724c1a513b92c716db9547021e5c836); r12 is the recorded post-merge conflict resolution under that PASS, independently covered together with the implementation by the six complete-worktree reviews of 2026-10-23, the sixth approving with no blocking findings (§10 closing record)."
  • §10 closing record: ## 10 design review record - r12 (post-merge conflict resolution) and the 2026-10-23 implementation approval.
  • Revision r11 section: "[r16 supersedes this revision's V_adopt/adoption-line decisions; the round-27 PASS remains the recorded independent approval of the same-version content r16 keeps. See the Revision r16 section.]"
  • Operative design approval: "PASS at r17 by the round-53 independent design re-review of 2026-10-27 (artifact pre-pr-review-1793069602436.json; reviewed content sha256 f2a2d2d0d68c41fd10e889a6357f75f22028c7213bffef6eb31d1fe4b2e18611)", preceded in the trace by the r8–r10 REQUEST_CHANGES records with their successor-resolution rule — so "Explicit PASS records stop at r7" describes only the orphan document's superseded text.

3. The approval artifacts exist and are identified. The r17 PASS artifact and the full pre-pr-review-* series are retained in the external loop archive referenced by the issue board's branch-delivery record ("Design-only PASS for docs/design/20261021-issue-25590-workspace-scaling-and-cleanup-ownership.md, r17, SHA-256 f2a2d2d0…"), independent of the mo-bot retrieval surface that reported evidence.json empty.

@XuPeng-SH

XuPeng-SH commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: fce13c950cc6dbb7a62ad578c616e23bcf8c5a10

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: fce13c950cc6dbb7a62ad578c616e23bcf8c5a10

Assessment: approve

The outstanding test-cleanup finding is resolved: gate release is idempotent, registered before fatal assertions, and exercised by a cleanup-only regression. Verified unchanged production and design coverage remains applicable. No actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a1869d-820c-7212-9788-aecfb86a4141 · slot 0 · generation 2

Validation:

  • Verified frozen head, clean source, complete change map, and two-file increment since the prior approved head.

  • Three focused cleanup tests passed normally and under the race detector.

  • Both affected concurrency tests passed separate race-enabled runs of 100 repetitions each.

  • Isolation preflight, native-library provenance qualification, git diff --check, and formatting checks for 64 Go files passed.

  • Reconciled all 93 discussion entries. Commands, terminal receipts, logs, and source fingerprints are recorded in validation-evidence.json and final-validation-receipt.json.

Limitations:

  • Prior full-review coverage was reused after source comparison; its original raw artifacts were unavailable.

  • Frozen CI statuses were inspected without raw CI logs. Full-suite, cluster SQL, restart, and performance checks were not rerun for the test-only increment.

This branch was successfully deployed

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

Labels

kind/bug Something isn't working size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants