Repository navigation
Add tenant-scoped changed-table lists and source snapshot checks - #32904
Conversation
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: fbff81c907635fea47f9b2c166c403c090a0cbdc
Assessment: request_changes
The feed reuses the existing publication barrier and checkpoint index to bound tenant-scoped scans. Both earlier findings are resolved. One recovery issue remains when a valid TN route becomes unavailable during the final check.
Model: gpt-6.2-sol / xhigh
Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3
- P2
pkg/sql/changedtables/read.go:218: A watch starts with a valid route to the only configured TN shard. During the read, the replica advertisement disappears or two advertisements tie at the latest heartbeat tick.
Impact: The watch publishes no END and returns 20105. Collectors following the documented recovery contract cannot recognize the interruption as an automatic retry of the same marker and can stall until intervention.
Evidence: The focused Read probe returned 20105 for both missing and tied advertisements. A clean replacement returned the expected 22603, and an unchanged route completed successfully. Classify temporary loss of a usable route during the final check as 22603 while preserving rejection of unsupported topologies. See route-recheck-handoff.log.
Validation:
-
Focused race tests passed in 11 packages, including the compaction retry and invalid-memo controls, exact checkpoint and WAL replay boundaries, marker validation, and SQL planning.
-
The MySQL proxy race test passed with the CN-local protocol number lowered. The first runs stopped at the Unix socket path limit. The successful retry used a diagnostic overlay that changed only the socket directory.
-
Verified the frozen diff, pinned policy, isolation preflight, and native build. validation-reconciliation.json matches the test logs to their commands, source fingerprints, and exit receipts.
Limitations:
- The route finding was reproduced at the CN Read entry point using controlled HAKeeper snapshots. A live TN handoff and release-scale workloads were outside local execution.
LeftHandCold
left a comment
There was a problem hiding this comment.
复核 d493474:前两轮的三条代码意见在当前源码中均已处理。compaction 期间 source 被清除会返回 22603,而损坏的 memo 仍单独报错;CN 不再以本地协议号代替实际能力判断;最后一次 TN 路由核对会将临时丢失、并列或更换路由归到 22603,真正不支持的多分片拓扑仍拒绝。
合并前建议先把 MO 与采集端共同认可的接口契约固定下来:PR 关联的是问题调查,当前描述给出了实现和测试,但未链接可追溯的已评审设计版本。下面这个 BASELINE 粒度差异会直接影响调用方是否重复发起整租户采集。无需新写一份 RFC 或改 TN,请链接现有方案的最终修订,并让采集端确认接受的消费语义。此次是设计和既有 finding 的复核,不是全量代码/CI 放行。
XuPeng-SH
left a comment
There was a problem hiding this comment.
Request changes: establish the reviewed consumer contract
The current PR body now describes a useful v3.1 contract, including the two-table example. However, I could not find a revisioned design decision accepted by both the MO owner and the MOI consumer. The linked matrixflow issue is an investigation and explicitly leaves implementation to follow-up. The author's review comment asks for consumer confirmation; the thread was resolved by the author without a recorded response. The PR body was subsequently updated, but that edit alone does not establish consumer acceptance.
This is a public SQL API and durable marker/recovery protocol across the collector, CN and TN. The distinction is observable: for one source with registrations A and B, the feed emits two BASELINE rows with source_count=1 and baseline_count=2. A consumer following the earlier per-source description could read the whole source twice, or group before validating counts and reject a complete END. Failure and recovery also depend on preserving the old marker until destination writes finish.
Please link the final revision of the existing design or contract and record the MO and MOI owners' acceptance of this behavior. The record should make the A/B example, raw-row count validation before grouping, EOF/END handling, marker advancement and retry/recovery behavior explicit. A separate RFC is not necessary if a revisioned PR or issue design section is used and its approval is traceable.
The three earlier code findings have corresponding fixes on d4934748fa: compaction now yields the retry error while invalid live memos remain errors, the CN protocol-number gate was removed, and the final route check classifies missing, ambiguous or replaced routes as retryable while rejecting unsupported topology. Current-head CI is green. This review resolves those earlier findings but stops at the design gate; it is not a full implementation or rollout approval.
|
In response to the requested changes, the implementation at
Owner confirmation is still open. Could the MO API owner and the MOI collector owner each reply here confirming v3.1, or identify the specific behavior that needs to change? In particular, the A/B example should schedule one read of each table. The implementation and CI verify the producer side. The earlier thread closure did not record the collector's acceptance. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: d4934748fa3d08a20eb7e88f0c55d5425600513c
Assessment: request_changes
The feed reuses the existing publication barrier and checkpoint index. The scoped RPC adds the exact table authorization and completion checks the feed needs. All three prior code findings are resolved, and v3.1 now documents one BASELINE row per registration. Two capacity paths still need fixes so collectors can recover without losing their saved marker.
Model: gpt-6.2-sol / xhigh
Session: 01a1ed86-9b09-7303-8d78-76024e7bf652 · slot 3 · generation 0
-
P2
pkg/vm/engine/tae/rpc/scoped_changed_tables.go:279: A valid resume marker requires checkpoint history and the admitted index contains 1,024 blocks that must be read from object storage.
Impact: Even a one-tick request can exhaust the 15-second TN deadline with no competing watcher. The collector receives 22603 and is told to retry the same marker. If the blocks stay cold and storage latency persists, the retry does the same work and the feed cannot advance.
Evidence: The scanner reads every block serially before proving coverage. The frozen PR report records 1,024 GETs for a one-tick request and a timeout for a lone request with 20 ms injected per GET. Bound the reads needed to prove the requested window, or expose an actionable capacity limit with a supported way to resume from the saved marker. -
P2
pkg/sql/changedtables/catalog.go:241: A scope stays within 100,000 registrations but its catalog projection exceeds the 128 MiB result budget. Wide persisted CHECK definitions can push the projected table metadata over that limit.
Impact: Both baseline and resume queries fail with a generic SQL error. A collector following v3.1 cannot recognize the capacity condition and take the documented recovery action.
Evidence: The query projects raw t.extra_info and passes the executor error through. pkg/sql/compile/sql_executor.go:877 returns executor.ResultLimitError when the byte budget is exhausted. Translate that error to 22604 at the watch boundary and identify the catalog budget in the diagnostic.
Validation:
-
Verified the frozen patch, merge base, pinned policy, and target-side function and opcode IDs. See source-verified.log and target-merge-verified.log with receipts 1795229501554754677-2 and 1795229973939717628-2.
-
Isolation preflight and the native CGo build passed. See preflight.log and native-build.log with receipts 1795229141777799303-6 and 1795229233666266795-6.
-
Selected tests completed successfully in ten packages, and both TN admission tests passed before the overall command deadline. See targeted-tests.jsonl and receipt 1795230141743733592-2.
-
Frozen CI records successful Ubuntu unit tests and both active multi-CN BVT lanes. The prior review reports TN and Proxy coverage at fbff81c. A source comparison confirms that the only subsequent changes are the CN route check and its test, which passed locally. See prior-evidence-scope.log and receipt 1795230514223988609-2. All 11 discussion entries are accounted for in discussion-assessment.json.
Limitations:
-
The remaining local TN RPC and Proxy runs reached their command deadlines. The Proxy retry used an overlay limited to shortening the test socket path. validation-reconciliation.json pairs those incomplete runs with their receipts and logs.
-
The sustained-latency finding uses source reasoning and the frozen MinIO report. Production object-store latency and write throughput at 1,024 blocks remain unmeasured.
-
MOI collector execution and owner acceptance of v3.1 remain unverified. The frozen release compatibility jobs were skipped.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 9f75690452bf382eada810a5f7630c7a52671fae
Assessment: request_changes
The registration row limit bypasses the v3.1 capacity recovery contract. The design reuses the existing publication barriers and checkpoint history, and the batched reads address the earlier timeout on the tested MinIO layout. The revisioned v3.1 contract is sufficient to review the MatrixOne producer.
Model: gpt-6.2-sol / xhigh
Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3
- P2
pkg/sql/changedtables/catalog.go:354: A valid watch query reaches 100,001 effective registrations while staying below the catalog byte budget. Provisioning can cross this limit between the initial read and the final recheck.
Impact: The query returns no END and reports invalid input. A collector following v3.1 misses the 22604 capacity handling even though its marker is valid and the operator needs to reduce the registration scope.
Evidence: The grant query deliberately reads up to MaxTables+1 rows, but decodeWatchGrants returns ErrInvalidInput at the cap. The catalog probe reproduced this through readCatalog (catalog-capacity-probe.log, checks/1795256724336999767-2.json). Return ErrChangeWatchCapacity for the registration row cap and verify that both catalog reads surface 22604.
Validation:
-
Verified the pinned checkout, complete patch, textual target merge, and generated opcode descriptor. See scope-verification.log and api-descriptor.log.
-
Private /tmp and loopback preflight passed. The error-identity test and 39 focused regressions passed across SQL planning and execution, ObjectIO, logtail, checkpoint replay, and TN RPC. See moerr-test.log and focused-regressions.log.
-
TestChangeWatchProxy passed after a test-only overlay moved its Unix socket into the executor's private /tmp. The original run hit the socket path length limit before issuing SQL. See proxy-short-socket.diff, proxy-short-socket.log, and checks/1795256919985738538-2.json.
-
Frozen head CI reports a successful shared build, Ubuntu x86 unit tests, static analysis, and multi-CN Proxy and pessimistic BVT.
Limitations:
-
MOI collector implementation, owner acceptance, and destination write recovery remain unverified. The review covers the MatrixOne producer.
-
The MinIO latency measurements and shutdown-upgrade runs come from retained author evidence. Frozen upgrade CI was skipped.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: e6091034f1a036e46ce342707b64180f7d54281b
Assessment: request_changes
Checkpoint retirement can interrupt a resumable watch with a generic SQL error, bypassing the documented same-marker retry. The v3.1 producer design reuses the publication barrier, checkpoint index, and logtail. It defines one row per registration and count validation before grouping. The earlier catalog-capacity, TN routing, compaction, and batched-read findings are resolved.
Model: gpt-6.2-sol / xhigh
Session: 01a1ee80-0d82-7030-a965-b51f496c3054 · slot 2 · generation 1
-
P2
pkg/vm/engine/tae/rpc/scoped_changed_tables.go:248: A resumed watch selects a checkpoint index. While the scan is in flight, a successor checkpoint becomes current and disk GC deletes the selected index before a read completes.
Impact: The watch withholds completion and returns MySQL 1105 / HY000. A collector following the v3.1 contract misses the 22603 signal to retry its saved marker, even though the successor index covers the same window.
Evidence: The scan returns file-service errors directly. Checkpoint GC includes table-ID index files in its deletion set and can retire them after the scan selects a checkpoint. The gated TN handler probe recorded internal error 20405, which maps to MySQL 1105, and the identical request completed against the successor index. Return 22603 when a missing index belongs to a checkpoint that has since been superseded. -
P3
pkg/tests/issues/isolated/mo_change_watch_test.go:60: Run TestChangeWatchProxy with a long GOTMPDIR, as configured by the review executor. Go 1.27 uses that directory for t.TempDir.
Impact: The Unix socket bind fails during fixture setup, so the test cannot exercise the MySQL watch contract in this environment.
Evidence: The original run attempted to bind a 125-byte socket path and failed with invalid argument. The same test passed under race instrumentation when a test-only overlay used the executor's private /tmp. Allocate a short, test-owned socket path independent of GOTMPDIR.
Validation:
-
Verified the frozen head, merge base, clean checkout, patch, pinned review policy, and git diff --check. The private runtime preflight passed. See scope.stdout and checks/1795275636143064489-2.json and checks/1795275636043144417-2.json.
-
Focused race tests passed in 12 packages, covering catalog and marker handling, SQL planning and execution, ObjectIO, scoped RPC dispatch, and TN logtail and replay. The command exited 1 at Proxy socket setup. See watch-race.stdout and checks/1795276427386149157-2.json.
-
TestChangeWatchProxy passed under race instrumentation with the socket setup overlay. See proxy-short-socket.stdout and checks/1795276580233701597-2.json.
-
The checkpoint retirement probe failed the expected 22603 assertion. Its same-window control completed against the successor index. See retired-index-retry.stdout and checks/1795276533285023163-2.json.
Limitations:
-
The checkpoint retirement interleaving was forced at the TN handler and file-service boundary. The SQL error mapping was verified in source.
-
The 100,000-registration and object-storage scale results came from the frozen PR evidence. MatrixFlow consumer rollout was outside this review.
On file-not-found, compare the selected physical index with the current checkpoint before classifying the error as retryable. Cover retirement, retry, and a missing live index through the TN handler. Use a short private Unix socket directory in the Proxy integration test.
|
Addressed both findings from the checkpoint retirement review in 71ff2ac.
All 56 TN RPC tests passed both normally and under |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 4d3b51a9b93c72c955587df800c3e75d0003b0e2
Assessment: approve
The MatrixOne producer implements the v3.1 contract with one baseline row per registration and one terminal END carrying raw row counts. It reuses the existing publication barrier, logtail, and checkpoint index. The prior retry, capacity, and Proxy fixture findings are resolved. A retired index now returns 22603 for a same-marker retry, while a missing file in the current index still surfaces the storage error.
Model: gpt-6.2-sol / xhigh
Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3
Validation:
-
Verified the frozen checkout, patch, pinned policy, and native inputs. Isolation preflight passed. The generated descriptor adds only opcode 2018. See scope.log, native-verified.log, preflight.log, and api-descriptor.log.
-
Passed 48 distinct top-level tests under race instrumentation, including the MySQL Proxy test without a fixture overlay. See focused-race.jsonl, additional-owner-race.jsonl, and proxy-race.jsonl with receipts 1795317263212741759-2, 1795317222732417436-2, and 1795317267325198476-2.
-
The retired-index regression passed 17 consecutive race-instrumented runs. Each checked the retry response, successful replay against the successor, and the storage error for a missing current index. See checkpoint-retire-race.jsonl and receipt 1795317349199571816-2.
-
Frozen head CI recorded successful builds, Ubuntu unit tests, static analysis, and both active multi-CN BVT lanes.
Limitations:
-
The MatrixFlow collector, its owner acceptance, and destination write recovery were outside this MatrixOne producer review.
-
Release upgrade jobs were skipped in frozen CI. Scale, object-store latency, and long-window replay measurements came from the supplied earlier-revision evidence.
✅ Merged into
|
What type of PR is this?
Which issue(s) this PR fixes:
Related to matrixorigin/matrixflow#21894.
What this PR does / why we need it:
Adds a registered-table change feed for incremental collection and a source-side assertion for the transaction that consumes the feed.
BASELINEreports every registration for a new or changed source scope. A registered name that no longer resolves to an eligible table has a NULL table ID. Regranting a name, truncating a table, or recreating it changes the affected source's scope.CHANGEDreports eligible registered tables with candidate committed DML in(from_ts, to_ts], including inserts, updates, and delete-only transactions. Conservative checkpoint ranges can yield extra candidates.ENDis the terminal row and carries the watermark, marker, and counts. Run the unmodified query, read through normal EOF, and verify the counts. Persist the new MEDIUMTEXT marker only after all destination writes succeed, including writes from a recovery baseline. If a destination write fails, keep the previous marker and retry the pending round. An empty scope also returns anEND.SELECT mo_assert_snapshot_after(?)as a standalone statement on the source connection in the same explicit transaction. The assertion returns true only when the currentSnapshotTS > END.to_ts, comparing both HLC components, and leaves the snapshot unchanged. AWHEREpredicate can be skipped on empty input and cannot serve as this read barrier. On22601 / 40001, roll back and retry the same watermark in a fresh transaction.MOI consumer contract (v3.1)
A source account has two registered tables A and B. The registration stays the same across both calls.
ENDsource_countbaseline_countchanged_countBASELINE(A),BASELINE(B)source_countincludes every source in the effective scope, including sources with no output rows this round. Count the rawBASELINEandCHANGEDrows before grouping. Read through normal EOF and verify these counts against the single terminalEND. A missing registered table still counts as one baseline row and has a NULL table ID. Process each returned registration once. A collector that batches by source can group the verified rows and process that source's returned registrations in one pass. Advance the marker only after all destination work succeeds. Review example · Registration regression · Terminal-count regressionAuthorization and rollout
The optional
etc/launch/optional/mo-change-watch.sqlbootstrap creates two sys-owned tables and leaves the feature disabled. A trusted provisioning service controls the registration table. Each registration binds observer, source, database and table names to a grant UUID. Only an observer'saccountadmincan query its own scope. Sysmoadmincan explicitly select another observer. Source data access follows the source account's normal SQL privileges.The marker binds the observer instance, recovery epoch, prior watermark and source digests. Each query rechecks live authorization and scope before publishing rows. The watch requires one authoritative TN shard and ordinary persistent user tables. Partitioned parent grants return a named error before publication. A wire probe read three committed rows with sum 66 on a source CN with partition service enabled. On a CN with it disabled, the same query returned a count of zero without error.
Ordinary quoted names containing
%!%remain eligible. For a name matching the legacy partition-leaf pattern, the CN checks the physical ID in the source account's partition catalog in bounded batches at the same cut. A confirmed leaf is represented as missing, like other hidden physical relations. An unavailable partition catalog fails the query.After cloning or restoring a snapshot, block watch ingress while reconciling registrations and rotating the recovery epoch. After reopening ingress, an existing collector can submit its retained marker and use the
22602recovery path below.Known constraints and recovery
MatrixOne upgrades by stopping all cluster services, replacing their binaries, and restarting them together. This follow-up uses the existing scoped RPC and preserves cluster framing, checkpoint and marker formats.
CN takes a TN publication barrier, waits for local logtail application, and resolves registrations at that cut. The TN scan accepts only exact authorized
(account_id, database_id, table_id)tuples. A baseline-only round checks TN capability without scanning retained history. A second barrier fences the authorization and topology checks before publication. Thecatalogandrecheck-cataloglabels onmo_txn_change_watch_phase_duration_secondstime the two CN catalog reads separately from their barriers and record failed attempts as well.The TN requires continuous checkpoint and logtail evidence over the requested interval. The default table-ID history window is 24 hours, with actual coverage and scan capacity checked per request. Each request admits up to 100,000 exact table tuples. The TN admits one active incremental scan and one waiting scan, with 15-second TN and 30-second CN deadlines. The configured limits are 1,000,000 in-memory logtail work units and 1,024 persisted index blocks of up to 8,192 rows each.
A failed watch publishes no completed
END. Only22602authorizes discarding the marker as a resume input and starting a NULL baseline. Keep its persisted bytes until that baseline and its destination writes are complete.22602 / HY00022603 / HY00022604 / HY000Candidate 4 replayed an unchanged marker across an older global checkpoint after a real table
FLUSHand returned one extra registered table. The fixture performed no user DML on that table inside the returned window. A separate realFLUSHon candidate 4 returned zero candidates for its current window. A physical rewrite can still produce a conservative candidate during checkpoint replay. TreatCHANGEDas a candidate list.Validation completed
Review base
87c44445f83e308ef12dd7ca0e570cec1e6690d9. Candidate 4 (1d81a96b43833bf95ba1b095512b8011ae12eddd) passed the 5,000 × 20 qualification and the native 12- and 24-hour replays.1d81a96b43).1d81a96b43) reused the original unmodified 100-byte marker issued by candidate 1 across a restart. Over 43,201.117 seconds it returned exactly the three authorized table IDs for committed INSERT, UPDATE and delete-only transactions, with zero baseline rows, zero history fallbacks and exit 0.The error-handling follow-up (
dbe9fd5b73) passed a real MySQL-driver regression through MO Proxy. Equal and stale snapshots returned22601/40001and left the transaction and snapshot unchanged. A damaged marker returned20301/HY000with zero rows and noEND. The original marker then resumed successfully.The
moerrand marker tests andmake err-checkpassed on the follow-up. Pinnedgolangci-lint2.14.0 reported zero issues across 15 affected packages. The full remote run is tracked in MatrixOne ALL CI.Remote CI on
dbe9fd5b73Attempt 1 passed SCA, Ubuntu UT Coverage, and the multi-CN COMPOSE/pessimistic and Proxy BVT jobs. The Ubuntu race UT job failed overall. Its diagnostics recorded a 61.46 s pass for
TestChangeWatchProxyand the following failures. Ubuntu race UT, attempt 1TestConvertRowsIntoBatchTemporalTextassignedtime.Localwhile a timer read it intime.Now(). The stack matches the previously reported race in the unchanged base test. #32893TestIssue31401ScalarRefreshProgress/other_accounthit a deadline in cleanup SQL,DROP ACCOUNT IF EXISTS issue31401_scalar. An earlier report records the same cleanup SQL timing out in thetenant_snapshotsubcase. One focused-racerun ofother_accountpassed on each of the clean base and PR revision. The cause of the original failure remains undetermined. #32570TestEmbeddedPrebuildCancellation/buildhit a process-snapshot deadline. Five isolated repetitions passed on each of the clean base (87c44445) and the PR revision. The cause of the full-lane failure remains undetermined.Separately, the global 120-minute hard timeout stopped the embedded phase, and
make utreportedError 124. Why the full run reached that limit remains undetermined.MatrixOne ALL CI attempt 2 completed successfully on the same commit on November 19, 2026 at 09:21:33 Beijing time. Ubuntu race UT and CI Required passed, and the Ubuntu Unit Testing step passed at 09:20:39. MatrixOne ALL CI, attempt 2
Candidate 4 scale results
The 5,000-source × 20-table layout completed all four phases on one TN and two CNs with 8 CPUs and a 72 GiB container memory limit. Independent catalog checks confirmed 100,000 physical table identities. Each phase ran 20 queries and verified the exact returned identities and terminal counts.
Independent 1,000-source × 100-table qualification
The
dbe9fd5b73build completed all four phases and the cancellation check (exit 0) in a fresh catalog. Independent SQL confirmed 100,000 distinct registered physical tables across 1,000 sources, plus separate unregistered control tables. The run used the same limits as the 5,000 × 20 layout, with one TN, two CNs, 8 CPUs and 72 GiB of container memory.An earlier candidate 4 attempt used a shared catalog with 180,000 user tables and ended with exit 1. A separate control query returned file not found (20405). Baseline, zero and sparse reads passed after switching control tables. The all-changed writes and cancellation check remained incomplete. Ordinary source writes hit 90-second timeouts. TN's send timeout and CN's reset refer to the same logtail connection. The final per-table retry timed out while subscribing to
mo_catalog.mo_userduring sys authentication, before issuing DML or watch SQL. The logs leave the cause undetermined and contain no evidence attributing a timeout to the watch catalog join or this PR.A follow-up ran clean base
87c44445f8(binary SHA-25680a24a39638462b2b35b4d0e5a4e4e8be8d58f21af9a43deb4a94d9b6d217983) and PRdbe9fd5b73(binary SHA-256ae510a76a9f42247b917a6c6209d3145a871f57624f980c2aa4a15bd1ff21daf) on two private cold copies of that same offline catalog. Both CNs reached SQL readiness in about 125–126 seconds per version. With watch disabled and verified on both CNs, each version passed six fresh tenant logins andSELECT 1queries, plus four ordinary upserts on the two historical source/table pairs. The opposite CN verified the exact values0 → 1 → 2for each table. Both arms exited 0, with zero post-readiness SQL errors. The earlier concurrent preparation timeout remains unexplained by this bounded test.A read-only follow-up on another cold copy verified the same 180,000-table catalog and a 100,000-table watch scope. The tested
3e9886c5d1binary shares production source with59b32cfb2e. The actual full baseline took 7.553 s and the zero-change replay from its marker took 5.316 s. Both completed their initial and recheck barriers. Fixed-cut grant joins at the two published cuts returned 100,000 rows in 2.554 s and 2.176 s. TheirEXPLAIN ANALYZEexecutions took 2.261 s and 2.090 s. Eachmo_tablesscan examined 660,497 rows and emitted 180,037 after filtering. The later published cut replays the recheck query shape at a published watermark.The scale runs report absolute MySQL latencies from different builds and catalog conditions. The bounded read-only follow-up completed without reproducing the write or authentication timeouts.
Ordinary SQL writes with watch unprovisioned
These throughput and latency measurements use PR head
dbe9fd5b73. On host 128's NVMe storage, clean base87c44445f8and PRdbe9fd5b73used the same build settings and ran in three matched pairs in base/PR, PR/base, base/PR order. Each of the six runs completed 112,000 timed INSERT/UPDATE transactions across eight MySQL clients, with exact row and counter readback and zero SQL errors. The watch catalog was absent, all PR watch phase counts stayed at zero, and each TN compacted 268–271 logtail blocks during its timed window.Median paired PR changes were +0.21% for throughput, −0.42% for transaction p95, −0.64% for transaction p99, and −0.74% for TN CPU per commit. Transaction p99 ranged from −1.77% to +1.71% across pairs. Sampled TN peak RSS ranged from 516.51 to 550.84 MiB on base and from 520.05 to 542.39 MiB on the PR. The comparison showed no business-write regression in this fixture. It can miss smaller TN costs because the CN averaged 2.90 of its three pinned cores and the workload touched two business tables. The
TryCompactmicrobenchmark times one block of 256 synthetic committed transaction records per operation. Six paired samples had median increases of 8.91% for one table and 7.56% for 256 distinct tables. Median paired differences were 2,747 and 3,330.5 ns per block, or 10.73 and 13.01 ns amortized per synthetic record. The benchmark excludes transaction setup and execution and defines no business row count. Compaction also runs with watch unprovisioned.Two additional matched pairs used 32 MySQL clients and a TN pinned to one core. The TN averaged 88.6–88.9% of that core. All four runs completed 192,000 timed commits each, verified the full SQL readback, and compacted 564–569 logtail blocks per arm. The paired PR changes were +0.81% and −0.04% for throughput, −1.07% and +2.07% for transaction p95, −1.36% and −4.55% for transaction p99, and −0.75% and +0.33% for TN CPU per commit. These runs used two business tables and lasted about 78 seconds each.
Writes during rollback and reupgrade
Two independent rollbacks from
dbe9fd5b73used clean PR base87c44445f8and an archived binary stampededaafb6668withvcs.modified=true. On both old binaries, ordinary SQL committed INSERT, UPDATE, delete-only, and unregistered-table writes. Both tests verified the committed values, checkpointed, restarted the old services, and observed old-version disk GC physically remove a disposable object. The old TN logtail cutoff advanced beyond the write window on both runs, and that pass evicted zero in-memory blocks.After reupgrade, both drivers supplied the original marker bytes and received the three expected changed table IDs, one permitted extra candidate for an unchanged registered control table, and one
END. Both omitted the unregistered table and completed without a new NULL baseline.Follow-up validation
Revision
bb8c3a9ef221b8ee494718793cf568864dd673a5passed 23 targeted top-level regressions across four packages (10 + 4 + 8 + 1), including the real MySQL Proxy test. All five packages checked by go vet passed, diff lint reported zero issues, andmake err-checkpassed.A separate real MySQL Proxy test rotated the recovery epoch between the initial and recheck catalog reads. The in-flight query returned
22603 / HY000with zero rows and noEND. Retrying the same input returned22602 / HY000. Disabling the feature returned20105with zero rows and noEND.The history regressions passed twice in normal mode on the production follow-up and passed with race instrumentation on
b8809cdc9e. Focused race tests in the owning error, SQL and TAE RPC packages also passed.A persisted index fixture shaped as 288 five-minute intervals verified a small authorized scope over 1,008,002 rows in 124 blocks. It checked the exact final cut, deduplication, wrong-tenant exclusion, coverage intersection, capacity and malformed-row failure.
Separate real INSERT and delete-only commits survived two incremental checkpoints, including a later interval with both watched tables idle, and index-only replay of both exact commit windows after restart.
The tested revision
59b32cfb2ef3c9588843b33c6a8e94062a49d520adds a test-only result-set cleanup after3e9886c5d1e32862440301be9b49d229c46addb6. The production revision switches two deadline causes to MatrixOne error constructors and passedmake err-checkand focused SQL and TAE RPC tests. The realTestChangeWatchProxyand four-package lint passed at the test-only revision. The earlier MySQL Proxy fault-injection test verified22602/HY000,22603/HY000, and22604/HY000with zero rows and zeroENDs. With the injected error removed, the fixture could still read from the original marker.An isolated SQL projection A/B on a cold copy with the
dbe9fd5b73binary returned the same 100,000 physical IDs across 20 reads per projection. Adding rawextra_infoadded 1.1 MB of payload per read (11 bytes per table in this fixture) and 1.2 MB on the MySQL wire. Median elapsed time was 614 ms and 626 ms. The measurement covers these catalog-only queries with this metadata size.A controlled merge through the production TN scheduler set the maintenance flag, combined two objects into one and preserved four independently read rows. Its exact commit window yielded 0 of 1 authorized candidates in live logtail and 1 of 1 in checkpoint replay. A separate direct, untagged invocation yielded 1 of 1 in both paths.
Concurrent watch and ordinary writes on host 128
All three successive windows used the same clean
75139b406b9407a35680a41d298e296d2bf65bfebinary (SHA-2561a7f32a5a58a13c3b85cdc43efaf850c229b3da282cab4866cc66633f5f20569) and a private copy of the 100,000-table fixture. Each window completed 80,000 timed SQL transactions across eight clients with zero SQL errors. Readback verified 169,600 event rows including warmup and all 256 counters per window.Two distinct observer tenants each watched 50,000 registrations. They verified 57 and 56
ENDs wholly within the timed window, each with its one expected changed physical table. There were 115 cross-observer request pairs that overlapped within the timed window and zero watch errors. Both control windows recorded zero watch activity.Throughput with watch was 4.31% below the first control and 3.79% below the second. Both watched p99 values fell between the controls. The control-to-control drift limits attribution of a tail-latency effect from this single ordered comparison.
The archived checkpoint metadata from
75139b406brecords 483,799 index rows at GCKP LSN 456692 and 483,813 index rows at ICKP LSN 461104. Each index used one object and 60 blocks on the fixture's local NVMeDISK-V2backend. The 3.79–4.31% range and the reported p99s describe this earlier fixture. The ordinary-write measurements above cover the 60-block NVMe fixture.Checkpoint reads and catalog capacity at
9f75690452The follow-up batches contiguous checkpoint column reads within one object, validating all history blocks and coverage rows. Each group reads up to 16 blocks with an 8 MiB limit each on stored and decoded column bytes. Admission remains one active scan and one waiting request with the same 15-second TN deadline.
The native TN handler read 86 MinIO objects containing 1,024 blocks and 8,388,608 synthetic history rows. The data cache was disabled. GET counts came from an HTTP proxy. The full window included the first metadata reads. The one-tick tests reused metadata and still read persisted column data.
d4934748faThe earlier concurrent run used distinct observer scopes. The follow-up used disjoint scopes and verified one matching table for the first observer and an empty complete result for the second. Timings are individual measurements on local MinIO. Object layout and storage latency affect achievable capacity. Ordinary write throughput was measured only on the earlier 60-block fixture above.
The catalog now maps a typed internal SQL result limit, including rollback-wrapped errors, to MySQL
22604 / HY000. Its primary projection retains the 128 MiB limit. A MySQL Proxy regression lowered the statement budget to one byte on a real registration to exercise the executor path. The previous head returned generic MySQL1105 / HY000for both the initial catalog read and the final incremental recheck. This revision returned22604 / HY000for both, with zero rows and zero ENDs. Restoring the normal budget allowed the original marker to resume.Nine scoped TN tests, seven focused ObjectIO tests, the changedtables package tests, and incremental vet and lint passed.
A separate MySQL Proxy regression at
e6091034f1exercised the registration row limit with one observer, one physical source table, and registered names for missing tables. Exactly 100,000 effective registrations returned 100,000 BASELINE rows and one END. With 100,001 registrations at the initial read, or with a concurrent provisioner adding the 100,001st grant between the initial read and the final recheck, the client received22604 / HY000and zero rows, including zero ENDs. The previous head returned20301 / HY000in both cases. The larger projection retained 13,300,133 batch bytes under the production 128 MiB budget. Removing only the extra grant allowed the original marker to resume with the expected CHANGED row and one END.Native 24-hour replay
At 17:36:25 Beijing time on November 19, 2026, candidate 4 (
1d81a96b43833bf95ba1b095512b8011ae12eddd) replayed the same unmodified 100-byte marker used for the 12-hour run. The original marker SHA-256 was7958937a5c6361cc38b928b3c73b9c54ea22913eb46b67c8fe0bb85503179e2d. The actual incremental window was(1794994584211878192-0, 1795080985296459238-0], or 86,401.084581046 seconds. It returned exactly the three expected changed physical tables, zero baseline rows and one verifiedEND, and exited 0.Production build
3e9886c5d1e32862440301be9b49d229c46addb6(SHA-25641a0b386679f41b9d6e4e5887987c0df9a352b69e1d82aea245118ca4b27c264) replayed the same original marker and lower cut on a network-isolated cold copy that carried the original recovery epoch. It advanced to1795081183730522148-0, spanning 86,599.518643956 HLC seconds at a wall-clock age of 86,599.553568493 seconds. Independent reads confirmed the same three physical table IDs (285231, 285232 and 285233). The query emitted threeCHANGEDrows, zeroBASELINErows and one verifiedEND, and exited 0.