Skip to content

[Feature]: Consolidate durable execution boundaries to reduce non-model turn latency #1119

Closed as duplicate

Description

@gouhongshen

Existing issue search

  • Searched open issues for persistence latency and durable turn performance; no matching scoped issue found.

Problem

A local Astra release build against an isolated account on a dedicated MatrixOne CN takes about 6 seconds for a fresh "hello" turn with an immediate deterministic model stub. Interleaved baseline/candidate measurements (10 each) show approximately 208 SQL/transaction operations and 17 transactions before run_finished; about 90% of the wall interval overlaps SQL waits. A first atomic input audit/transcript batching experiment reduced this to about 204 operations / 16 transactions, but P80/P90 improved only ~1.12x/~1.13x and mean latency did not improve.

Requested capability

Consolidate durable execution boundaries and transaction-local admission facts so the normal agent path does substantially less synchronous database work. Acceptance target: at least 3x lower P80 and P90 non-model turn latency under interleaved same-environment tests, followed by multi-round and correctness regression coverage.

Design constraints

  • MatrixOne remains the durable source of truth; no success publication before required commits.
  • Preserve billing admission, immutable identity/hash collision checks, lost-ack reconciliation, session deletion fences, cancellation and owner-generation takeover safety.
  • Reuse canonical storage owners and typed transaction-local receipts; do not introduce cross-transaction authorization caches, fallback paths or relaxed timeout/gates.
  • Empty recovery should prove there is no work in one owner-scoped snapshot, rather than run the full reconstruction transaction.
  • Consolidate run/session/canonical turn admission and terminal boundaries where their existing contracts allow it.
  • Preserve explicit lock order. A multi-table locking JOIN is not yet proven safe: some Work writers do not take the lifecycle fence.
  • Benchmark using an isolated test account only; no business-data or deployment modifications.

Validation

Keep every measured sample, alternate A/B and B/A order, identify exact build revisions and CN execution routing, and count overlapping SQL wait intervals once. Distinguish a genuine improvement from environment drift. Targeted database tests must cover replay, collisions, deletion, cancellation, expiry, takeover and ambiguous commit. No 3x result has been achieved yet.

Consolidated evidence and acceptance

This issue also tracks the concerns previously recorded in #980 and #1124. Preserve the independent scenarios and their original measurements:

Activity

  1. added
    kind/feature
    on Oct 22, 2026
  2. XuPeng-SH commented on Nov 15, 2026

    @XuPeng-SH
    Collaborator

    已合并追踪至 #1302 的第 5 节。保留同环境 P80/P90 至少 3× 和历史真实 provider 场景 P90 低于 7 秒的独立目标。

    此关闭仅表示将追踪入口合并,不表示原问题已全部修复。原报告、讨论和尚未满足的验收条件继续作为新 issue 的证据与验收来源。

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions