Skip to content

Move ordinary ApplyAppend out of the TN commit queue - #30629

Merged
XuPeng-SH merged 50 commits into
matrixorigin:mainfrom
jiangxinmeng1:move-aobject-create-outside-txn-v2
Oct 26, 2026
Merged

XuPeng-SH merged 50 commits into
matrixorigin:mainfrom
jiangxinmeng1:move-aobject-create-outside-txn-v2

Conversation

@jiangxinmeng1

@jiangxinmeng1 jiangxinmeng1 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • Improvement
  • Code Refactoring

Which issue(s) this PR fixes:

Fixes #30623.

What this PR does / why we need it:

Move ordinary transaction ApplyAppend out of the serialized TN commit queue into concurrent Freeze. Keep ordering-sensitive deduplication, transfer, prepare timestamps, WAL and commit publication in their existing transaction phases. The original design was manually approved by misuxi; the design document now describes the reservation, ownership and cancellation boundaries.

The table append mutex selects, validates, creates and publishes the current candidate. It is released before waiting for object reservation. Each attempt reads the current shared candidate, so delayed owners cannot restore an obsolete carrier. Reservation uses the existing object/MVCC synchronization; materialization uses monotonic reserved ranges after releasing allocation locks. Independently committed ordinary carriers survive creator cancellation, and preparing-transfer keeps its existing timestamp/lifecycle contract.

Candidate rejection no longer performs synchronous sealing under the table mutex. Capacity exhaustion and compaction retain that responsibility; an unknown max-commit bound remains conservative. The current Freeze/pre-prepare context reaches safe reservation boundaries without per-row polling. Existing append-max metric publication reads current counts under its publication mutex to avoid stale gauge restoration.

Remove unused metric/statistics plumbing and successful-read diagnostics. Connect bounded cached scan counters and actual Freeze/queue-stage timers. Regression coverage exercises real commits/reads, both object kinds, rollover without surplus carriers, cancelled-creator survival, late materialization, replay/transfer/rollback and unexpected-error handling. Old-source overlays fail the new isolation and sealing regressions at their intended guards.

Current local validation

Linux/x86 follow-up (2026-10-24), head 817b06715df4671fbdf4fa9a37ec00d5827992cb, rebased onto main at b264f5df894c9e5aba5e852e73f6a5acd80e3614. All 43 prior commits replayed without conflicts; range-diff verified equivalent patches. Two follow-up commits improve padding and fix a replay compatibility defect.

Production pessimistic/RC performance acceptance remains open. This update does not claim merge readiness or a full-service TPS improvement. The earlier contaminated performance comparison is not a proven regression; current ambient I/O pressure prevents a controlled production acceptance run.

Corrections and optimization

  • Confirmed legacy WAL compatibility fix: OnReplayAppendPayload reaches positional installation, which previously omitted the existing mo_tables fallback from rel_id to an absent rel_logical_id. The actual replay entry reproduced NULL instead of 7 while the old sequential append control passed. Both paths now use one predicate based on destination column, authoritative system-table ID and input-column absence. Explicit supplied values, including NULL, remain authoritative. No WAL/disk format or locking change.
  • Bulk physical padding: replace three scalar NULL-padding loops with the existing ReserveRowsLocked owner. Keep one-row appends unchanged; larger gaps reuse vector bulk growth, memory accounting and NULL metadata handling. Preserve delayed payloads and rollback holes, without temporary vectors or new state.
  • Extend existing out-of-order tests for long varlen, empty/NULL payloads, bitmap boundaries, trailing holes and reapply. Upgrade-schema replay now uses 129 rows to exercise bulk padding. The new replay regression also covers nonzero offsets, preserved later payloads, same-schema user-table exclusion, repeated replacement and explicit NULL.

Current validation evidence

  • Complete PR owner scope: all 15 packages containing tests passed under -race; two additional owning packages contain no tests. There were 1,897 passing test nodes and four existing test skips at the padding revision. After the compatibility correction, revalidated full tables and txnimpl normally and under race (249 passing nodes per mode), plus 52 DB/engine recovery/replay/restart/Freeze test nodes under race. Unchanged closures reuse the earlier valid results.
  • Full pkg/vm/engine/tae/db/test after the final correction: 311 passing nodes, one existing skip, 45.807 seconds. Five core owning packages passed normal validation; final changed owners were rerun after the compatibility correction.
  • Incremental SCA: the complete 17-package scope passed vet, molint and configured golangci-lint (0 issues); the final changed tables package passed all three again. Formatting, diff whitespace and error checks passed. Final make build also passed using the repository defaults (GOAMD64=v3, GOEXPERIMENT=simd). Go 1.27.1, fresh verified native libraries, repository CGo wrapper, GOMAXPROCS=2, bounded build concurrency and private disk-backed test scratch were used.
  • Actual solution/design and complete-change review used gpt-6.1-sol / xhigh; its confirmed replay finding was reproduced and corrected. Final re-review at 817b06715d passed for publishing this update; session 01a170fb-f30c-7a80-94c2-7403707db017. The full-feature production performance merge gate remains open.
  • Earlier-head remote CI passed build, SCA, coverage, race UT and both pessimistic/proxy BVT groups. Those are historical results, not current-head BVT or CI acceptance. This final head's remote CI is pending; no new full BVT run is claimed locally.

Local padding benchmark scope

Sequential original/candidate runs of the committed BenchmarkReserveRows, three 300 ms samples per size; median nanoseconds/op below. The original production mnode.go was overlaid without changing the benchmark. These measure a fresh small memory node, not SQL throughput, complete Freeze latency or the production performance acceptance criterion.

Reserved rows Original Candidate
1 2,021 2,091
2 2,531 2,068
8 5,338 2,105
64 14,636 2,201
1,024 98,616 2,578
8,192 805,942 18,426

At 8,192 rows this operation is approximately 43.7x faster, with Go allocations/op reduced from 40 to 17. One-row allocations remain 16; a bounded reverse-order five-sample check gave medians 2,011/2,037 ns (original/candidate). The single-row measurements do not establish a zero-regression guarantee. No full-service performance benefit is inferred from these microbenchmarks.

Earlier validation receipts

Rebased the existing 41 feature commits onto main at 3878a13ef00fc85b1bced8a58a4f7d17df848806; the rebase itself preserved the original net patch byte-for-byte. Subsequent fixes were reviewed separately and reconciled with the complete feature.

  • macOS arm64, Go 1.27.1, repository CGo runner and verified native libraries; service build passed.
  • Seven incremental checks passed: repository-toolchain formatting, diff whitespace, error definitions, license headers, vet, molint and configured golangci-lint against the verified base.
  • Full affected allocator/catalog/transaction owners: 442 normal and 439 race test selections passed. Full tae/db/test: 312 normal and 312 race selections passed. Direct checkpoint consumer passed normally and under race. Other unchanged owning-package evidence was reconciled after the rebase.
  • Four concurrent reservation regressions passed under -race -count=100. Final repaired test synchronization also passed focused normal/race checks.
  • The optimistic SQL directory is not green: the earlier candidate and pinned main both produced 2703 successes, 331 failures and 102 ignored statements out of 3136, with the same 330 identifiable error locations. Existing optimistic-DDL expectations conflict with main's pessimistic-RC lifecycle requirement. This is baseline comparison evidence, not a claim that the full SQL suite passed.
  • Actual gpt-6.1-sol / xhigh design and complete-change reviews were used. Final review disposition: no unresolved material blockers within the reviewed delivery and requested local workload scope; stop at the current D2 lock-boundary fix rather than add an unproven additional admission redesign.

Earlier local performance scope (optimistic / SI)

Separate LOG/TN/CN processes, GOMAXPROCS 2/4/4; 128 independent PK update streams, 20-second warmup and 300 seconds active load. No Linux CPU affinity is available on this macOS host. Main has identical temporary timing probes for comparison; they are not part of this PR. Freeze and queue histogram populations differ and must not be added together.

Build / sample TPS Client p95 Client p99
Main, first sample 5792.5 37.6 ms 60.6 ms
Rebased allocation path before lock fixes 4762.2 54.2 ms 106.3 ms
Padding-only intermediate 5718.8 37.6 ms 60.5 ms
Final implementation, first sample 5191.6 45.5 ms 111.6 ms
Final implementation, tracked follow-up 5923.4 35.7 ms 55.7 ms
Main, tracked follow-up 5715.3 38.7 ms 71.2 ms

Every sample had zero workload errors, exact final row/sum/commit accounting, drained CN queues and normal service shutdown. The first final-build sample was worse than the first main sample; the tracked follow-up recovered main-comparable throughput and tails. The samples do not establish a stable causal regression or a statistically proven speedup.

For the tracked follow-up, Preparing p95/p99 histogram upper bounds were 0.267/0.669 ms for the final build versus 0.321/0.804 ms for main; PreparingWait was 1.675/2.905 ms versus 2.012/2.905 ms. Freeze was 3.490/6.052 ms versus 0.386/0.804 ms, reflecting the append work moved into that phase. CPU, mutex and block profiles were captured separately. The tracked final-build mutex profile totals 246.86 seconds of cumulative contention versus 15.52 seconds for main, and sampled TN CPU is higher. Same-object reservation remains the dominant final-build mutex frame; removing another lock without demonstrated end-to-end benefit is not claimed as a completed optimization.

The original rebased allocation path and a padding-only intermediate candidate retained dominant table-mutex contention. The final implementation removes that table-wide convoy. Same-object row reservation still requires serialization; its profile attribution is assessed alongside end-to-end results rather than treated as recoverable time by itself.

A reverse-main sample overlapped another project's Rust compilation and is explicitly excluded from performance acceptance. Other observed OS/UI load and brief compiler activity at the end of paired main are retained in the local experiment record. These local runs do not establish a universal no-regression claim for every TP workload.

Production-path follow-up: pessimistic / RC (2026-10-24)

These additional local results refer to source d91dedb740; no kernel changes were made. The earlier six-row local performance table above was collected in optimistic/SI mode and is not production pessimistic performance proof.

  • Two local CNs plus TN/LOG: live mo_transactions() verified both CNs were Pessimistic/RC. Real waiting stacks traversed LockOp and remoteLockTable; TN Freeze counters advanced during SQL commits.
  • Thirteen public-path functional/boundary groups passed: cross-CN waits, full rollback after timeout, KILL QUERY, disconnect cleanup, duplicate batches, CSV/NULLs, concurrent commit/rollback plus flush, 16385 rows crossing three physical carriers, large deletes/reinserts, prepared reuse and contended updates. Both-CN row-by-row checks passed after forced TN restart/WAL replay.
  • 24 existing pessimistic SQL files: 3045 successful statements, 0 failed, 320 existing @ignore statements skipped, 0 abnormal; approximately 201 seconds. The skipped statements are not claimed as covered.
  • A test-only overlay exercising long varlen payloads, empty strings, NULLs, delayed padding and abort holes passed normal/race runs. It does not change repository code or constitute a newly committed regression test.
  • Existing fault injection selected one real pessimistic transaction after WAL completion but before ApplyCommit. After killing/restarting only the owned TN, both CNs read the exact once-committed balances and audit row. The client received 20638 (commit outcome unknown), so blindly replaying business operations would be unsafe.
  • First-write recovery probes observed 1205 or 20702; the pinned main baseline reproduced this too. Separate bounded probes retained the initial failure and observed a successful fresh transaction after about 3.47 seconds (candidate) / 0.54 seconds (main). The probe explicitly used a 3-second lock timeout; this is not evidence of a production 120-second timeout or a permanent lock leak.

Pessimistic performance remains open. One matched 300-second/128-key local comparison, with runtime mode verified:

Build TPS Client p95 Client p99 Workload errors
Candidate 3892.3 61.2 ms 147.6 ms 0
Pinned main with identical timing probes 4149.2 58.0 ms 138.1 ms 0

The candidate sample is 6.19% lower in throughput. Both runs had exact data accounting, drained queues and clean service exits, but both overlapped unrelated Go compilation and ambient OS/UI/VM load. This single pair neither establishes a stable causal regression nor proves zero regression. Same-object Freeze contention remains prominent; the 60-second TN profiles recorded 82.39/49.47 CPU sample-seconds and 206.05/11.03 cumulative mutex-delay seconds (candidate/main). Profile windows differ from aggregate TPS windows, so these are not exact per-transaction cost figures.

The earlier overall review covered its then-measured local scope. It must not be interpreted as closing this newly measured production-mode performance question.

Historical author evidence

Earlier remote results below predate the final local fixes and are retained as historical context, not current-head validation.

The author previously measured remote host 10.222.1.51 with CPU affinity, a 128-key/300-second update workload, and broader Sysbench 1000W cases. At the earlier feature head e899f733bd, queue waiting and overall Preparing were lower than the historical main sample; PrepareCommit was still slower. Those separate-run results predate the fixes above and are not final-head evidence. The original discussion and benchmark progression remain in the author follow-up.

The earlier Sysbench comparison is available in branch regression and main regression. It is indicative historical context, not a controlled validation of this final build.

This local follow-up does not establish the current remote CI status.

Index-first dedup follow-up (2026-10-26)

Commit 7bb1e3908 removes the redundant PrepareTS-ordered AppendNode index and changes in-memory AObject PK dedup to search ART first, then check only matching RowIDs against AppendNode PrepareTS and abort state. The cold flush-retry path scans physical-row-ordered nodes when it needs the latest PrepareTS.

On remote host 10.222.1.51, the full pkg/vm/engine/tae/db/test, tables, updates, and indexwrapper test packages passed; focused race tests passed with -count=5. The optimistic 128-key/128-worker, 300-second full-service update workload completed 60,812 updates with zero errors and exact final row/sum accounting. LOG, TN, CN, and clients were pinned to separate CPU sets.

TN stage (average / P95, µs) Earlier main Previous branch Current 7bb1e3908
PreparingWait 59.7 / 354.9 17.8 / 35.3 37.7 / 199.5
Preparing (overall) 53.6 / 121.1 44.8 / 88.5 49.7 / 118.2
PrePrepare 7.1 / 24.2 7.5 / 27.4 6.9 / 32.5
PrepareCommit 1.4 / 4.5 4.6 / 13.8 2.7 / 13.0
PreApplyCommit 2.8 / 10.5 0.25 / 0.55 0.18 / 0.43

The current column uses the 60–240-second TN histogram window. The historical columns came from separate runs; their temporary substage probes and the current built-in stage histograms do not have identical sample populations. In the current run, PreparingWait/Preparing have about 35,382 transaction samples, while each detailed queue stage has about 125,198 observations; these stages must not be summed.

Compared with the previous same-host no-index/full-row-scan candidate, PrePrepare dedup averaged 63.4 → 21.2 µs and the 60-second TN CPU profile no longer shows GetRowSelectionAfterLocked (previously 13.4% of sampled TN CPU). However, full-service throughput fell from 83,324 to 60,812 updates in separate runs, while the broader PrepareWal interval grew from about 191 to 275 ms. This is not a claim of end-to-end performance acceptance; WAL/apply or environmental effects require a controlled follow-up.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH

XuPeng-SH commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-xupeng · done

Commit: 54ea40ee552edf610ca05d43d029711fed7fe0e9

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-xupeng · review

Commit: 54ea40ee552edf610ca05d43d029711fed7fe0e9

Assessment: request_changes

The major transaction-pipeline refactor lacks the required linked, reviewed design. This is a confirmed design-contract omission, not a demonstrated runtime defect.

Model: gpt-6-astra / xhigh

Session: 01a15209-2c6d-71e2-b8f3-aa17387fa283 · slot 2 · generation 0

  • P2 pkg/vm/engine/tae/txn/txnimpl/table_space.go:65: FreezeApply moves append installation before serialized commit preparation, alongside new writer admission, MVCC ordering, rollback cleanup and asynchronous catalog bookmarks.
    Impact: This changes concurrency, ownership and recovery contracts, triggering the repository's mandatory design-first review. Add or link a versioned design covering reservation/publication ordering, rollback before CSN assignment, transfer/replay correctness, lock ordering, resource bounds and validation criteria; record approval of that revision before implementation approval.
    Evidence: The 55-file delta contains 2,975 added and 535 deleted production Go lines, including priorityWriterGate, dual MVCC indexes and restart-sealed bookmarks. No design document changes, matching tracked design, linked design revision or design approval appear in the frozen sources/evidence. .agents/skills/mo-dev/references/feature-design-review.md sections 1–2 explicitly require these artifacts for major concurrency/lifecycle refactors.

Validation:

  • Verified exact HEAD, merge-base and clean source. The supplied patch matches the Git delta except its terminal newline.

  • Traced Freeze through txnDB, txnTable and tableSpace, plus early-append rollback, writer-gate and MVCC/catalog ownership changes to establish the design trigger.

  • Static audit passed: checks/1792469164252656931-4.json, exit 0. Report and retained log: /home/xupeng/.local/state/mo-bot/jobs/1faba1d178a421941bd0272e/attempt-1/design-gate-audit.json and design-gate-audit-v2.log.

Limitations:

  • The mo-self-review skill states that missing design approval 'short-circuits full implementation polishing.' Full implementation, concurrency, rollback/recovery and performance validation remain deferred at this gate.

  • No Go/native tests were run. local_validation is empty; the PR's reported focused command selected no tests, so it does not establish behavioral validation.

  • Issue #30623's body was not supplied. Performance figures were assessed as author-reported comparisons, not independently verified measurements.

jiangxinmeng1 and others added 13 commits October 24, 2026 22:15
Keep table-wide allocation limited to selecting and publishing the current
carrier, and reserve and materialize under the existing object ownership.
Propagate phase cancellation at safe reservation boundaries without removing
other transactions' committed carriers or reusing aborted physical offsets.

Publish current append-max counts, wire actual bounded phase observations,
and remove unused statistics and successful-read diagnostic overhead.
Exercise isolation, rollover, cancellation, late padding and lifecycle cleanup
through real transactions and strengthen unexpected-error test oracles.
@XuPeng-SH

XuPeng-SH commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 51994bd6c65754dbac5e19f0f38e8aa19d90443c

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: 51994bd6c65754dbac5e19f0f38e8aa19d90443c

Assessment: request_changes

The approved ownership design is reasonable, and the earlier table-wide lock scope and phase-attribution concerns are addressed. However, the explicit production performance acceptance requirement remains open.

Model: gpt-6-astra / xhigh

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

  • P2 docs/design/20261020-apply-append-outside-commit-queue.md:169: Validation requirement: concurrent pessimistic/RC commits now perform reservation and materialization during Freeze, with ReserveAppend and ApplyAppendAt serialized by object admission/MVCC locks.
    Impact: The required evidence has not established whether reducing commit-queue work transfers excessive contention or latency into Freeze. Before acceptance, provide controlled matched baseline/current-candidate production-mode runs with verified configuration, isolated TN/CN resources, write-heavy multi-PK queue pressure, separate Freeze/queue p95/p99, comparable CPU/mutex profiles, exact data accounting, and duplicate/WW-error and orphan-transaction checks.
    Evidence: Criteria 4 and lines 229–236 explicitly require current-candidate performance evidence. The frozen PR body states that pessimistic/RC acceptance remains open. Its reported 3892.3 versus 4149.2 TPS comparison overlapped unrelated compilation and ambient load; this is not a proven regression. Optimistic/SI results and the padding microbenchmark do not close this requirement. local_validation contains no retained execution receipts or profiles.

Validation:

  • Static audit verified the frozen head, clean source, supplied patch against the assigned range, all 62 changed-file fingerprints, and git diff --check.

  • Successful audit receipt: /home/xupeng/.local/state/mo-bot/jobs/493b8bb3ad2604a55e426925/attempt-1/checks/1792938894785638616-3.json; exit 0 with matching head and clean-source fingerprint. Output is retained in review-static-audit.log in the same attempt directory.

  • Source tracing confirmed table unlocking before object reservation, padding outside allocation locks, cached phase-specific metrics, and removal of the reported successful-read Info logging.

  • Detailed evidence reconciliation is retained in review-gate-record.md. The initial reviewer-script indentation assertion failure and corrected successful audit are separately preserved; neither represents a product test result.

Limitations:

  • Assessment stops at the material acceptance failure. Exhaustive correctness, compatibility, lifecycle and test-quality closure of the remaining MVCC/catalog, transfer and recovery changes is outstanding.

  • No native build, Go unit/race tests, SQL/BVT or performance workloads were executed. Historical author summaries were not counted as independently verified current-candidate passes; current CI execution evidence and the linked issue’s full body were not supplied.

@jiangxinmeng1

Copy link
Copy Markdown
Contributor Author

Follow-up for commit 7bb1e3908: removed the redundant PrepareTS-ordered AppendNode index and changed in-memory AObject dedup to query ART first, then check the matching RowIDs against AppendNode PrepareTS/abort state. The cold flush-retry lookup scans the physical-row-ordered nodes.

Remote 10.222.1.51 validation passed: full pkg/vm/engine/tae/db/test, tables, updates, and indexwrapper packages, plus focused -race -count=5 tests. The optimistic 128-key/128-worker full-service workload ran for 300 seconds with 60,812 successful updates, zero errors, 128 final rows, and SUM(v)=60,812. LOG/TN/CN/clients used separate CPU affinities.

TN stage (average / P95, µs) Earlier main Previous branch Current 7bb1e3908
PreparingWait 59.7 / 354.9 17.8 / 35.3 37.7 / 199.5
Preparing (overall) 53.6 / 121.1 44.8 / 88.5 49.7 / 118.2
PrePrepare 7.1 / 24.2 7.5 / 27.4 6.9 / 32.5
PrepareCommit 1.4 / 4.5 4.6 / 13.8 2.7 / 13.0
PreApplyCommit 2.8 / 10.5 0.25 / 0.55 0.18 / 0.43

The current numbers are from the 60–240-second TN histogram window. Historical columns are separate runs, and the earlier temporary substage probes are not identical in population to the current built-in stage histograms. The current overall transaction stages have about 35,382 samples, while detailed queue stages have about 125,198 observations; do not sum them.

Against the prior same-host no-index/full-row-scan candidate, PrePrepare dedup averaged 63.4 → 21.2 µs, and the old GetRowSelectionAfterLocked 13.4% TN CPU hot spot disappeared. But end-to-end throughput fell from 83,324 to 60,812 updates in separate runs; PrepareWal grew from about 191 to 275 ms. This is not an end-to-end performance acceptance result. Raw load, metric, and pprof artifacts are retained on host 51 under /home/mo/jxm/bench-pr30629-rowid-first-51994-20261026/.

@XuPeng-SH

XuPeng-SH commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 7bb1e39082612bc891a124c68664bf73c49aa172

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: 7bb1e39082612bc891a124c68664bf73c49aa172

Assessment: request_changes

The ownership design is reasonable, and current source addresses the earlier table-lock scope and phase-attribution concerns. However, the approved performance acceptance requirement remains open. The latest index-first dedup measurements demonstrate a narrower improvement, not controlled production-mode acceptance.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1

  • P2 docs/design/20261020-apply-append-outside-commit-queue.md:169: Concurrent pessimistic/RC transactions updating distinct keys of the same table execute reservation and materialization during Freeze, including object-level admission and MVCC locking.
    Impact: Validation requirement: establish that reducing serialized commit-queue work does not transfer unacceptable contention or latency into Freeze. Provide controlled, matched current-candidate/base production-mode runs with verified configuration, isolated TN/CN resources, queue-saturating multi-PK load, separate Freeze/queue p95/p99, comparable CPU/mutex profiles, exact committed-data accounting, and duplicate/WW-error and orphan-transaction checks. Retain source/build identities, commands, terminal receipts and logs.
    Evidence: Criterion 4 requires hotspot and phase-tail evidence; lines 229–236 explicitly require current-candidate results. The frozen PR body still states that pessimistic/RC acceptance remains open. The exact-head follow-up reports optimistic-mode dedup improvement from 63.4 to 21.2 microseconds, but compares separate historical runs with differing histogram populations and explicitly disclaims end-to-end acceptance. Its 83,324-to-60,812 update-count comparison does not establish causality. Functional CI and padding microbenchmarks do not close this requirement; local_validation is empty. This finding asserts an unmet validation contract, not a demonstrated production regression.

Validation:

  • Verified frozen HEAD, merge base, clean source, all 62 changed-file identities, patch equivalence apart from the terminal newline, and passing git diff --check.

  • Static audit passed with checks/1793001923443008438-4.json, matching command, head, clean-source fingerprint and exit 0. Retained review-gate-audit.py, review-gate-audit.log and review-gate-audit.json under the assigned attempt directory.

  • Reviewed the design and supplied discussions; traced Freeze, reservation/materialization, writer admission, index-first dedup and phase metrics against the outstanding acceptance concern.

  • The frozen exact-head CI snapshot reports successful build, UT, static analysis, coverage and proxy/pessimistic multi-CN BVT. These are not performance acceptance measurements.

Limitations:

  • Assessment stops at the material acceptance gap. Exhaustive independent correctness, lifecycle, recovery, compatibility and test-quality review of the remaining delta is not completed or approved.

  • No local native build, Go tests, SQL workloads or benchmarks were executed. Referenced remote benchmark logs and profiles were not supplied locally or independently reproduced.

  • Issue #30623's body was unavailable; requirements were assessed through the frozen PR discussion and approved design.

@XuPeng-SH

XuPeng-SH commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: ffc36a3400d2e506bcb0f590cb0efae438796216

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: ffc36a3400d2e506bcb0f590cb0efae438796216

Assessment: request_changes

The ownership design and latest lock simplification are reasonable: reservation and sealing share existing MVCC admission. However, the required production-mode performance acceptance remains open, and supplied measurements predate this changed locking path.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1

  • P2 docs/design/20261020-apply-append-outside-commit-queue.md:169: Concurrent pessimistic/RC transactions execute reservation and materialization during Freeze. This commit removes the freeze lock, while reservation, padding and payload installation still use object-level admission/MVCC synchronization.
    Impact: Validation requirement: establish that reduced commit-queue work does not transfer unacceptable contention or tail latency into Freeze. Provide controlled, matched current-candidate/base production-mode runs with verified configuration, isolated resources, queue-saturating multi-PK load, separate Freeze/queue p95/p99, comparable CPU/mutex profiles, exact data accounting, and duplicate/WW-error and orphan checks. Retain build identities, commands, terminal receipts and logs.
    Evidence: Design criterion 4 and lines 229–236 require current-candidate performance evidence. The frozen PR description explicitly leaves pessimistic/RC acceptance open. Latest measurements concern parent 7bb1e39 in optimistic mode and disclaim end-to-end acceptance; earlier pessimistic comparisons were contaminated by concurrent compilation and ambient load. No measurements cover ffc36a3's lock changes, and local_validation is empty. This is an unmet validation contract, not a demonstrated production regression.

Validation:

  • Verified frozen HEAD, merge-base, clean source, supplied patch, all 63 changed-file identities and passing git diff --check.

  • Reviewed the complete eight-file follow-up and traced Freeze, reservation, sealing, writer admission, materialization and metric owners. Reconciled the prior static audit without treating it as exhaustive implementation approval.

  • Audit passed with checks/1793013096793202569-3.json: matching command, current-head fingerprint and exit 0. Logs, audit and artifact hashes are retained in the assigned attempt directory.

  • Frozen current-head CI reports successful build, UT, SCA, coverage and proxy/pessimistic BVT; these do not measure performance acceptance.

Limitations:

  • Assessment stops at the material acceptance gap. Exhaustive independent correctness, lifecycle, recovery, compatibility and test-quality closure of the remaining feature is outstanding.

  • No new native build, Go/race tests, SQL workload or benchmark was executed. Historical author measurements were not independently reproduced.

  • The linked issue body was not supplied; requirements were assessed through the frozen design and PR discussion.

@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.

APPROVE,针对 ffc36a3400d2e506bcb0f590cb0efae438796216。

复核最新八文件改动及 reservation → sealing → materialization 调用链:冻结判断、AppendNode 注册与行范围预留由同一 MVCC 写锁保护;候选失效重试和取消路径释放 appender 引用,未发现本轮锁简化的具体阻塞缺陷。当前提交的构建、UT、SCA、coverage、proxy/悲观 BVT 及 CI Required 均通过。

调整此前 review 的阻塞尺度:唯一遗留项是设计文档要求的进一步性能验收,现有证据未确认该提交存在性能回退。将其保留为非阻塞跟进,不再仅以此阻塞本次合入。本轮复用了现有评审和当前 CI 证据,没有新增本地测试或压测,也不据此宣称整体吞吐提升或绝对零回退。

@mergify

mergify Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-26 13:22 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ❌ Checks failed · in-place
  • 🚫 Left the queue — 2026-10-26 14:28 UTC · at fdd2e546d77a158a0bd0466dba6076f13fbb1329

This pull request spent 1 hour 5 minutes 12 seconds in the queue, with no time running CI.

Reason

The merge conditions cannot be satisfied due to failing checks

  • CI Required

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

This branch was previously deployed

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

Labels

dequeued kind/enhancement kind/refactor Code refactor size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move ApplyAppend out of the TN commit queue

6 participants