Repository navigation
[PR] storage: mysql on the proxy hot path (async shadow facade, #3388 step 3) - #3955
Merged
Merged
Conversation
ranxianglei
force-pushed
the
2026-10-20_mysql-hot-path
branch
from
October 20, 2026 11:31
b3c4684 to
b8ebf17
Compare
ranxianglei
force-pushed
the
2026-10-20_mysql-backend
branch
2 times, most recently
from
October 20, 2026 11:49
48c0384 to
288c795
Compare
Async shadow facade: sqlite keeps its zero-await sync fast path byte-for-byte; mysql rides a serial backend queue for saves (watermark deltas, reap journal, digest sampling, 3-strike disable) with the JSON envelope as the sync read path. Replicas/ext/GC speak async twins; admin awaits them. writerOff stays sqlite-only. Lazy disk-index seeding for bare-id cold loads on async backends only. MySQL e2e suite (hot path, envelope discipline, replicas/ext, restart warm) against real MySQL 8.0; sqlite families unchanged.
ranxianglei
force-pushed
the
2026-10-20_mysql-hot-path
branch
from
October 20, 2026 11:50
b8ebf17 to
a2b8bcd
Compare
This was referenced Oct 20, 2026
ranxianglei
added a commit
that referenced
this pull request
Oct 20, 2026
fix(deps): declare mysql2 + restore registry lock URLs; land the stranded step-3 merge (#3955)
This was referenced Oct 20, 2026
Zhishulo
pushed a commit
to Zhishulo/billion-context
that referenced
this pull request
Oct 20, 2026
…he stranded step-3 merge (ranxianglei#3955) master is red on two jobs since ranxianglei#3946 merged: - mysql-contract: package.json lost the mysql2 dependency when a local version-restore accident reverted the npm install --save edit (the lock kept the subtree), so the service lane cannot resolve mysql2. - lock-sync: 11 lock entries carried resolved URLs from the local install relay (127.0.0.1:4873); rewritten to registry.npmjs.org (integrity hashes were already the official ones). Also folds in 2350797 (the ranxianglei#3955 merge) which was accidentally merged into its stacked base branch (2026-10-20_mysql-backend) instead of master — this PR lands step 3 (mysql hot path) on master.
This was referenced Oct 20, 2026
This was referenced Oct 20, 2026
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3931 (step 3 of #3388). Stacked on #3946 (step 2) — merge that first.
What
storage.backend="mysql"now carries the proxy hot path, not just export:sync: UnifiedStorefast lane; all twins delegate straight through).ready()gates async consumers);viewFor/importRecordsync facades miss by design — callers already have documented no-sidecar fallbacks.loadEnvelopelazily seeds the disk index on async backends only so bare-id cold loads find namespaced files without a boot walk (sqlite keeps its 管理页面全量加载历史会话时触发堆 OOM:需要有界分页、摘要统计与详情懒加载 #1937 posture — web-sessions 24/24 pins that).createReplica,listReplicas,deleteReplica,replicaByteLen,restoreReplica,unifiedGc,unifiedRestoreArchivedare nowasync); admin handlers await them.maybeCutForkBasebecame an async twin (fork receipts on mysql).closeQuietlyAsync(): awaits the sidecar, cancels pending saves, drains the queue, closes the pool (tests and short-lived tools on mysql must use it or the pool keeps the loop alive).Explicitly degraded on mysql in v1 (all fail-safe, none silent-wrong)
incremental lane (sync unified reads) → honest 409 resync / unavailable; snapshot render → storage-off degradation; web session list → disk walk (
webSummaryBaselinereturns null so an empty authoritative row set can never blank the list).Verification
tests/storage-backend-mysql-e2e.test.ts(new, DSN-gated): hot-path save lands on the backend; envelope discipline (writerOff refused);viewForAsyncserves id + fold blocks; replica create/list/restore/delete; ext round-trip; restart stays warm (bareloadSyncthrough the lazily seeded envelope, re-ingest after restart). Green against real MySQL 8.0.46 (docker).tscclean.