Skip to content

Move ApplyAppend out of the TN commit queue #30623

Closed

Description

@jiangxinmeng1

Summary

Move ordinary transaction ApplyAppend work out of the TN commit queue and execute it during Freeze, so append application can run concurrently before the transaction enters the commit queue.

Motivation

The commit queue should retain the ordering-sensitive transaction preparation and commit steps, while the row allocation and ordinary append application can proceed concurrently. This reduces queue work and allows the queue workers to focus on ordering, timestamp assignment, deduplication, and commit processing.

Scope

  • Allocate row numbers and apply ordinary appends during Freeze.
  • Keep queue-side logic needed for transfer-generated delete/append handling.
  • Preserve MVCC visibility, deduplication, transfer, and merge/flush correctness.
  • Validate with db tests, optimistic transactions, and write-heavy sysbench workloads.

Activity

  1. XuPeng-SH commented on Oct 22, 2026

    @XuPeng-SH
    Contributor

    QA follow-up for PR #30629 at head 7548aeb84f4f85aaff987bb16d8325294e8ba900:

    The PR now includes docs/design/20261020-apply-append-outside-commit-queue.md, which addresses the missing versioned design artifact. The document states “Approved by: misuxi (manual approval)”, but I could not find a linked approval/review record in the PR review/comment history or this issue’s comments. Please link or record the approval trail so the design-first gate is auditable.

    This is a review-process verification item, not a confirmed runtime defect. I have not run MatrixOne tests locally; this workspace has no MatrixOne Git checkout and Go is unavailable. On this head, UT coverage, SCA, and shared build checks are still pending.

  2. XuPeng-SH commented on Oct 22, 2026

    @XuPeng-SH
    Contributor

    QA follow-up for linked PR #30629 at head 7548aeb84f4f85aaff987bb16d8325294e8ba900: the latest review requests changes for (1) shared incremental-dedup metrics attributing Freeze and queued pre-prepare work to identical series, and (2) missing required controlled workload/profile evidence for the approved design's performance/contention criteria. Full findings are in the PR review. This is a follow-up to the existing feature issue; no new issue is needed. Local tests were not run in this workspace.

  3. XuPeng-SH commented on Oct 22, 2026

    @XuPeng-SH
    Contributor

    补充跟踪 PR #30629 当前 head 7548aeb84f4f85aaff987bb16d8325294e8ba900 的新 review 发现(review)。我核对了对应源码;本地未运行测试。

    1. pkg/vm/engine/tae/tables/base.go:724,762 在 GetValue 两条读取路径上以 Info 级别记录每次读取,包含对象 ID、行和 batch 等字段。该函数可能处在逐行读取热路径,正常查询因此产生高频日志和格式化开销。建议删除这些调试日志,或降到 Debug。
    2. pkg/vm/engine/tae/txn/txnimpl/table.go:1260 对每次成功的 GetByFilter 主键查找记录 Info 日志,并格式化 txn 与 ID;这是正常点查路径上的逐次日志。建议删除或降到 Debug。
    3. pkg/vm/engine/tae/tables/aobj.go:188 改变了 CoarseCheckAllRowsCommittedBefore 的语义,但当前生产代码没有调用者,只有接口和测试引用。建议移除未使用的接口方法,或明确标注其测试用途,避免测试契约与未来生产行为漂移。

    前两项是读路径性能/日志量风险,第三项是接口维护风险;review 未报告它们为阻断性数据正确性缺陷。请在复核后处理或说明保留理由。

  4. XuPeng-SH commented on Oct 22, 2026

    @XuPeng-SH
    Contributor

    QA follow-up for PR #30629 at head bf0d1101d7b2396395621f0964c56b542d4aba88:

    • The phase-attribution finding from review 5610751359 is addressed in the current diff: dedup metrics now use bounded freeze / preprepare phase labels and add tests for independent samples.
    • The read-path logging findings from review 5610964587 remain in this head. GetValue still emits logutil.Info for point and scan reads in pkg/vm/engine/tae/tables/base.go; txnTable.GetByFilter still emits an Info record for each successful lookup in pkg/vm/engine/tae/txn/txnimpl/table.go. These are normal read paths and can add per-row/per-lookup logging and formatting overhead; please remove them or demote them to Debug.
    • The author’s latest PR comment reports a 300-second 128-worker test with 174,018 updates on main versus 169,731 / 163,058 on the branch (before/after metric-handle caching), zero reported client errors, and no sustained pre-WAL queue saturation. I did not run this workload. As reported, it does not establish the design’s queue-saturation benefit or required separate Freeze/queue tail-latency and profile criteria; the performance-evidence item remains open.

    This updates the existing findings; it does not assert a newly reproduced data-correctness defect. No MatrixOne service or Go test was run in this workspace.

  5. XuPeng-SH commented on Oct 23, 2026

    @XuPeng-SH
    Contributor

    QA checkpoint for PR #30629 at current head e899f733bd8d68c35c8724dd211d83a3b95a73fc (2026-10-23):

    • Compared with the prior checkpoint 5c3ccd1d96bfadf782f3b4f21d8d4679263cacb5: one commit removes the redundant PrepareTS-ordered AppendNode slice. The physical-row list remains the backing collection and the immutable PrepareTS snapshot remains the dedup index. The cold flush retry path now scans the row list to find the maximum PrepareTS; the added test covers out-of-order rows and an uncommitted later row.
    • The author reports current-head full db/test, updates/tables packages, focused race tests and a separate-CPU-affinity 128-worker workload passing with zero errors. The reported TN queue samples improve versus the earlier branch and earlier-main samples, but main was not rerun for this measurement; the detailed stage probes were temporary, not in the PR. These are author-reported results, not tests I ran. The approved design's no-new-hotspot/performance acceptance is still not fully demonstrated: no current Freeze-specific p95/p99 or profile evidence, no same-run baseline, and no queue-saturating result.
    • Existing per-read Info logging findings in tables/base.go and txnimpl/table.go remain in the PR diff; this one-commit increment touches only tables/updates/{append,mvcc,mvcc_test}.go. They remain potential hot-path logging/formatting overhead.
    • Exact-head GitHub status has no combined status entries. Iceberg Connector E2E is in progress and unrelated. No newer formal review was returned; the prior CHANGES_REQUESTED remains on an older head.
    • I could not run tests locally: this workspace has no MatrixOne checkout, go.mod, or Go executable.

    No new data-correctness defect was confirmed in this increment. Keep the performance and logging findings open; do not treat the author report as independent validation.

  6. added a commit that references this issue on Oct 26, 2026
    ccfca4f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions