Repository navigation
Description
Delivered in Native3.3.0
Implemented by #1084; qualified and published at source 2a15179f29801eec9f2a2d4e6a9c5f93233f104e / index sha256:cb4b11bd6235a551cf51e7dc6342504fbbcef19959618b376fb5648ca00fc388. Acceptance and scope limits. General reconciled this delivered item while the Server agent is Off. No benchmark speedup is claimed.
Original requirement and evidence
External performance report, topic 8. The reported timings and proposed fixes have not been independently reproduced. The supplied patches are reference drafts for review and current-source qualification.
Problem
The next queued transition waits for the current one's commit fsync to
finish before it even begins. PostgreSQL's advisory lock and MySQL's row
lock already pass to a waiter as the holder's commit releases them.
Each transition also makes round trips it doesn't need:
- PostgreSQL's BEGIN and its lock are two round trips;
- the completion reads the run's authored sequence twice;
- every history event's sequence is a read plus a write.
Proposal
- On PostgreSQL and MySQL, release the in-process queue (report topic 7) when
the commit starts. The next transition then begins and waits on the
database lock while this one commits. SQLite keeps the queue through the
commit, because its busy handler polls. - Send PostgreSQL's BEGIN and its advisory lock in one simple query.
- Read the authored sequence once per completion.
- Allocate a history sequence in one statement:
UPDATE ... RETURNINGon
SQLite and PostgreSQL,LAST_INSERT_ID(expr)on MySQL. A missing run,
or a sequence at its maximum, takes the old path and refuses as before.
Reported benchmark evidence
Reporter-supplied cumulative measurements, not an isolated-effect or independently verified performance claim: 200 sequentially started workflows, five sequential 20ms activities or five local activities each, six PHP worker processes, mean of three repetitions, one machine, fresh SQLite/MySQL8.0/PostgreSQL16 databases with default durability. "Five" and "local" below mean last-close wall time in seconds; S/M/P means SQLite/MySQL/PostgreSQL. Preserve regressions and noise in the reported results.
| five | local | |
|---|---|---|
| slowest backend | 22.60 → 21.48 | 5.47 → 5.71 |
Acceptance
- The next transition never reads uncommitted state. It still waits on
the database lock. - The exhaustion refusal is unchanged. The existing test covers it.
Dependencies
Related existing work: #325.
Draft patches and validation boundary
Current main was independently read as b8f4dd13623ce645de77ba5bd89ae8dd8eea2f7c. The supplied draft series targets 3d4d4afaf2b24aaa5443eac154e253b011924738; patches are cumulative reference material, not a current-main application or test result. Review and rebase on maintained source, preserve all existing tests and published compatibility, then establish causal controls and actual conformance before shipping. No patch was applied or executed during intake.
Known draft gap / required control: Overlapping commit must preserve database-lock ordering, committed visibility, durability and exhaustion refusal. Do not weaken fsync, transaction isolation or cross-process fencing to reproduce a timing result.
The following sanitized unified diffs identify proposed reference material:
0007-t08-Start-the-next-transition-while-the-last-one-commits.patch— 3,508 bytes, SHA-256dd6462fce4c781cd96fa2f7dbacae7cf62ecbd82d7dec1b55e82f25f01135dd6.0008-t08-Read-the-authored-sequence-once-per-completion.patch— 3,238 bytes, SHA-256cba2c41331743c5f612994c29a17924a2a2cb4fd2a5aaee9f38f99cf6a40b8d5.0009-t08-Allocate-a-history-sequence-in-one-statement.patch— 5,791 bytes, SHA-256bae07e98419dc06defe99fdff6d51c0df98b484198cafc5401bcb8cb86d435bb.
Current implementation: PR #1084, exact 6a8aacd89ad41391ad113ca3e4ea54ecbbc82d7c, is based on the accepted #1058 main 6bdb2c90. PostgreSQL/MySQL release the process queue after derived writes at COMMIT entry, while SQLite retains it. PostgreSQL combines BEGIN and its advisory lock in one simple query. Scope validation reuses its locked authored sequence. Ordinary history counters use one guarded update; each backend's retained column width and the original missing/exhausted/noncanonical path remain explicit.
New consumed backend controls cover committed visibility, cancellation before COMMIT, admission behind the actual database lock, fast versus original counter outcomes at boundaries, rollback, missing runs, malformed SQLite storage, and an actual completion's statement counts/contiguous history. git diff --check passes. Source qualification now passes all six original current-head workflows,62 successful checks/one declared skip. The new controls explicitly pass on SQLite, PostgreSQL16/17, MySQL8.0/8.4 and MariaDB10.11, with provider/download digest and tested-tree verification. Source-owner review has no remaining finding. The initial fixture compilation defect and superseded runs remain attributed in the PR; no performance or installed result is claimed.
Merged source: the original queue passed and merged #1084 as 4fb4cffc463d1d96bfce86231c12819bc2ad6b2a at 04:25:38Z. All48 original Shared queue jobs and the queue Feature suite passed. All five original automatic actual-main workflows passed at this exact merge. The main acceptance receipt preserves the original queue and source results. The exact merged remote head independently returns404; the clean owned worktree/topic is removed after ancestry verification.
Next owner/action: Server drives #1065 in PR #1085, then #1069, and prepares the exact-source native publication/qualification packet. The preceding source/main runs are terminal before this next CI train. Release/published acceptance remains open. No imported reference patch was applied.
Activity
rmcdaniel commentedon Nov 6, 2026
Sanitized reference diff
0007-t08-Start-the-next-transition-while-the-last-one-commits.patch, part 1/1.This is an unverified, cumulative draft from the external report. Mail author/date/commit-message metadata was removed; the unified-diff hunks were retained. No patch was applied or executed, and no build/test or compatibility result is implied. The known gaps and acceptance criteria in this issue remain mandatory.
Complete sanitized patch: 3,508 bytes, SHA-256
dd6462fce4c781cd96fa2f7dbacae7cf62ecbd82d7dec1b55e82f25f01135dd6. This part: 3,508 bytes, SHA-256dd6462fce4c781cd96fa2f7dbacae7cf62ecbd82d7dec1b55e82f25f01135dd6. Parts concatenate in order; a part boundary is between complete file diffs.rmcdaniel commentedon Nov 6, 2026
Sanitized reference diff
0008-t08-Read-the-authored-sequence-once-per-completion.patch, part 1/1.This is an unverified, cumulative draft from the external report. Mail author/date/commit-message metadata was removed; the unified-diff hunks were retained. No patch was applied or executed, and no build/test or compatibility result is implied. The known gaps and acceptance criteria in this issue remain mandatory.
Complete sanitized patch: 3,238 bytes, SHA-256
cba2c41331743c5f612994c29a17924a2a2cb4fd2a5aaee9f38f99cf6a40b8d5. This part: 3,238 bytes, SHA-256cba2c41331743c5f612994c29a17924a2a2cb4fd2a5aaee9f38f99cf6a40b8d5. Parts concatenate in order; a part boundary is between complete file diffs.rmcdaniel commentedon Nov 6, 2026
Sanitized reference diff
0009-t08-Allocate-a-history-sequence-in-one-statement.patch, part 1/1.This is an unverified, cumulative draft from the external report. Mail author/date/commit-message metadata was removed; the unified-diff hunks were retained. No patch was applied or executed, and no build/test or compatibility result is implied. The known gaps and acceptance criteria in this issue remain mandatory.
Complete sanitized patch: 5,791 bytes, SHA-256
bae07e98419dc06defe99fdff6d51c0df98b484198cafc5401bcb8cb86d435bb. This part: 5,791 bytes, SHA-256bae07e98419dc06defe99fdff6d51c0df98b484198cafc5401bcb8cb86d435bb. Parts concatenate in order; a part boundary is between complete file diffs.rmcdaniel commentedon Nov 6, 2026
Sanitized rebased reference for report topic 8:
0008-t08-Read-the-authored-sequence-once-per-completion.patch.The supplied revision targets Server
b8f4dd13623ce645de77ba5bd89ae8dd8eea2f7c. It is cumulative external reference material, not independently qualified against today's maintained source. Mail headers and commit-message/application instructions were removed; the unified diff is retained. The reporter now claims every rebased commit builds and the tip passes SQLite/MySQL/PostgreSQL tests. Those are attributed claims, not a new maintainer test result. Existing acceptance criteria, security findings and completed implementation receipts remain authoritative. Earlier attached patches are retained as historical references.Sanitized patch: 3,238 bytes, SHA-256
8acaf6c9311fbddb02029a1476e23e82376e8e1a40dcc4550ba5952050dd8dd9. Original-base sanitized identity:cba2c41331743c5f612994c29a17924a2a2cb4fd2a5aaee9f38f99cf6a40b8d5. No patch was applied or executed during this update.rmcdaniel commentedon Nov 6, 2026
Sanitized rebased reference for report topic 8:
0009-t08-Allocate-a-history-sequence-in-one-statement.patch.The supplied revision targets Server
b8f4dd13623ce645de77ba5bd89ae8dd8eea2f7c. It is cumulative external reference material, not independently qualified against today's maintained source. Mail headers and commit-message/application instructions were removed; the unified diff is retained. The reporter now claims every rebased commit builds and the tip passes SQLite/MySQL/PostgreSQL tests. Those are attributed claims, not a new maintainer test result. Existing acceptance criteria, security findings and completed implementation receipts remain authoritative. Earlier attached patches are retained as historical references.Sanitized patch: 5,791 bytes, SHA-256
6a9e950e03056f001c4e6d202db4595bfd8eee05e2bf65e2653e8d2e9997d7b5. Original-base sanitized identity:bae07e98419dc06defe99fdff6d51c0df98b484198cafc5401bcb8cb86d435bb. No patch was applied or executed during this update.rmcdaniel commentedon Nov 7, 2026
The maintained #1059 implementation is now draft PR #1084, exact a4ded60, tree 413142eb4546a54225c5893102983b2d27c04a9a on accepted main6bdb2c90. It implements all four source proposals with retained counter-width/fallback semantics and real backend visibility/cancellation/allocation/completion controls. The original #1083 main runs were terminal before this sole new PR train started. Hosted qualification is pending. Server owns fixes, ordinary integration/main and later release acceptance; #1065/#1069 follow in the user's order.
rmcdaniel commentedon Nov 8, 2026
Implemented by #1084 and delivered in Native3.3.0 at protected source
2a15179f29801eec9f2a2d4e6a9c5f93233f104e/ indexsha256:cb4b11bd6235a551cf51e7dc6342504fbbcef19959618b376fb5648ca00fc388. The accepted source head6a8aacd89ad41391ad113ca3e4ea54ecbbc82d7cindependently still shows62successful checks and1intended skip. Its merge is an ancestor of the release. The later integrated source head5f937ec8f385c71dc781875f2f38026b63277faahas a byte-identical rust/ tree to that release and passed the registered all-targets/ignored suites across the backend lanes.The next transition can begin admission while the prior commit finishes, but still waits on the database lock. Registered all-backend controls prove no uncommitted read, commit/cancellation visibility, and unchanged history-sequence exhaustion/refusal behavior.
Release provenance, published SQLite corpus, four-cell MySQL Compose acceptance, default-channel acceptance and the release's three-backend startup/identity smokes establish publication follow-through. The issue's functional/source controls and release delivery are complete. Closing with no benchmark reproduction, isolated speedup or installed contention-benchmark claim. Earlier NONPASSs remain attributed. This does not close the remaining P0 work or #1099.