Repository navigation
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
1 task done
1 of 7 tasks
mergify Bot
pushed a commit
that referenced
this pull request
Sep 16, 2026
Adds opt-in, table-owned `AUTO_ID_CACHE` support while reusing the existing `ALTER TABLE ... AUTO_INCREMENT` and session increment/offset implementations. ### Behavior - `CREATE TABLE ... AUTO_ID_CACHE=0` (or omitted) inherits the existing CN allocation policy. - `AUTO_ID_CACHE=1` reserves only actual automatic-row demand, with no constructor, estimate, low-water, or concurrency-driven speculative reservation. It does **not** promise globally monotonic or gapless IDs. - Values `2..1000000` override the base raw reservation span; larger actual demand can enlarge a reservation. Non-default session series still do not background-prefetch. - Reject invalid, duplicate, out-of-range options and nonzero policies without a visible auto-increment column. `ALTER ... AUTO_ID_CACHE` is not supported. - Persist the policy in `SchemaExtra`, project it through `TableDef` and allocator columns, and preserve it across cold CN loading, SHOW CREATE, LIKE/COPY/CLONE, rename, TRUNCATE, dump/load, and restart. - Keep demand-only `CurrentValue` observation non-reserving and preserve the existing pre-generation allocation-timestamp probe and deferred generated-ID publication. ### Rollout boundary — approved option A The production configuration defaults to **disabled**: ```toml [cn.auto-increment] enable-auto-id-cache = true ``` Enable only after draining workloads, stopping all old CN/TN processes, and upgrading every role. **Mixed-version operation and old-node reentry are unsupported.** The new V67 check and appended PRE_INSERT wire marker provide local/transport rejection, not cluster-wide admission or proof of upgrade completion. Disabled nodes reject nonzero CREATE and allocator-cache construction/use instead of silently applying their defaults. SHOW retains the persisted policy. Existing independent `ALTER AUTO_INCREMENT` offset/epoch maintenance remains available and preserves the policy. Disabling is not data rollback; in-place downgrade with nonzero-policy tables is unsupported. The standalone, multi-CN, compose BVT examples and shared feature-test fixture explicitly opt in for fresh, same-version test clusters. No platform admission state machine, additional allocator table, background worker, or per-row capability RPC is introduced. This PR does not independently fix or close the separate REPLACE/IGNORE issues. ### Design and review The allocator/metadata design and rollout option A were approved before their respective implementation phases. Exact delivered revisions: - [AUTO_INCREMENT r4 design](https://github.com/ck89119/matrixone/blob/69552cf461a558e696826d2adaca03fdb13c652f/docs/design/CLAUDE_AUTO_INCREMENT_23371.md) - [AUTO_ID_CACHE rollout A/r1](https://github.com/ck89119/matrixone/blob/69552cf461a558e696826d2adaca03fdb13c652f/docs/design/CLAUDE_AUTO_ID_CACHE_ROLLOUT_23371.md) Self-review covered the complete change map, metadata readers/writers and recovery paths, ownership/cancellation/retirement, bounds, protocol rejection, and delivery artifacts. Generated parser/protobuf files were regenerated with repository tools and reproduced identical SHA256 hashes; most diff volume is generated parser tables. ### Validation Local validation used darwin/arm64, Go 1.26.4, and the repository `mo-cgo-test` wrapper with matching native artifacts. - Owning packages passed: `incrservice`, `sql/plan`, `sql/parsers/...`, `sql/compile`, `pb/api`, `pb/plan`, `vm`, `vm/engine`, the entire `disttae` package, `disttae/cache`, `tae/catalog`, `cnservice`, and `embed`. - Five individually selected race tests each passed **100 repetitions** after duration-based budget selection: concurrent cache demand, cancellation/retirement, concurrent session series, cold services/probes, and runtime gate cleanup. Entire `incrservice` and `sql/compile` packages also passed once under `-race`. - Changed-line coverage: **250/271 = 92.25%**, mapped from Go coverage blocks, excluding generated files and tests; this is not whole-package or branch coverage. - `TestAutoIDCachePublicLifecycle`: real two-CN cold loading, DDL lifecycle, rename, and public stage/object dump/load passed. - `TestAutoIDCacheRestartAndDisabledNode`: permanent isolated-cluster test passed through full shutdown, disabled restart, rejection/no-partial-DDL checks, and enabled restart with the expected next ID. - Real mo-tester BVT: generated/reviewed `.result`, then **67/67 twice on the same instance**, with zero failures/ignored/abnormal statements and independently verified database teardown between runs. Test services were closed. - Default one-row allocation benchmark, upstream vs feature, five 2-second samples each: median 1248 vs 1234 ns/op; both **0 B/op, 0 allocs/op**, approximately 0.0001 reservations/op. No material default hot-path regression observed; no claim of statistically significant speedup or zero cold-catalog overhead. - Before submission, synchronized `mo/main` through `3d22c694a8` and reran plan/compile owning tests and the public lifecycle test successfully. Other evidence is reused from `cd04bb4c1a` because the intervening SET/FIND_IN_SET change does not alter the validated CACHE protocol, allocator, or recovery paths. - `git diff --check` passed. TODOs, local logs, caches, and temporary harnesses are excluded. ### Review follow-up — transaction-owned observation and ALTER normalization Fixed in `5d72ca9e9d`, after merging upstream through `d3794ea964`: - Demand-only observation now runs in the actual table-cache owner: uncommitted CREATE uses its transaction, while committed caches use a fresh committed read. The lazy wrapper retains the delegate for the entire observation. No IDs are reserved by SHOW/information_schema queries. - After all ALTER COPY clauses are applied, clear the inherited policy only if the final definition has no visible auto-increment column. MODIFY/DROP now succeed; keeping or transferring the auto-increment attribute preserves the policy. Direct CREATE validation and truthful SHOW rendering remain unchanged. - Added pre-fix failing regressions, commit/rollback and lazy-owner coverage, final-definition/internal-CREATE controls, and real SHOW TABLE STATUS/information_schema plus MODIFY/DROP controls for policies 0/1/8. - Updated owning incrservice/plan/compile tests and public lifecycle passed. The two affected observation tests each passed 100 individually selected race repetitions; the entire incrservice package passed once under race. - Follow-up changed-line coverage: **19/22 = 86.36%** (Go block mapping, excluding generated files/tests). The earlier 92.25% above records the initial implementation, not this incremental fix. - Updated mo-tester result was regenerated and reviewed; normal comparison passed **89/89 twice on the same instance**, with zero ignored/abnormal statements and verified teardown. Services were closed. - The generated plan protobuf merge conflict was resolved by repository tooling; regeneration reproduced the same SHA256. No TODOs or local validation artifacts were committed. ### Upstream conflict resolution Merged `mo/main@d3e8ace` in `27707b0f93`. Preserve upstream V58 for binary-string/runtime-domain semantics; AUTO_ID_CACHE now requires **V59**, with unchanged wire opcodes, field numbers, and rollout contract. Both independent remote-pipeline gates remain intact. Tests explicitly reject CACHE at V58 and accept it at V59. Focused gates, complete incrservice/compile/process/plan/frontend tests, and the real two-CN public lifecycle all passed on this merge. The two executable lines changed by the manual conflict resolution are covered (2/2); this is not a coverage claim for all incoming upstream code. Earlier unchanged allocator/race/BVT evidence is reused rather than reported as newly executed. The [updated rollout document](https://github.com/ck89119/matrixone/blob/27707b0f93fbc52b2b1c6b227fbc3389159cfa4b/docs/design/CLAUDE_AUTO_ID_CACHE_ROLLOUT_23371.md) records the protocol-number reassignment; the earlier design links above preserve the original approved revision. ### SCA follow-up (535269d) Merged upstream through `401b967dc1`, including #28555, which removes the unused CDC helper reported by SCA. No lint suppression was added. Upstream now owns V59 for FORMAT; AUTO_ID_CACHE therefore requires **V60**, with unchanged opcode/field numbers and rollout contract. Latest-version and dedicated boundary assertions were updated together. The rewritten remote branch was merged without force-pushing; its merge tree is identical to the locally validated tree. Repository-configured golangci-lint 2.6.2 passed for issues/incrservice/compile/queryservice-client. Complete incrservice/compile/queryservice-client/embed tests, the public AUTO_ID_CACHE lifecycle, and both CDC watermark ordering scenarios passed. This records targeted local validation, not a claim that the new full SCA run has passed. ### Latest review follow-up (`089c2e68cb`) Current protocol requirement is **V64**; earlier version numbers in the historical follow-ups are superseded. - Reject AUTO_ID_CACHE in PARTITION/SUBPARTITION option lists, including zero, at the shared parser boundary. Table-level placement and existing partition options remain supported. Added 12 parser counterexamples/controls, public SQL rejection with no published table, and BVT cases; regenerated the parser using repository tooling with repeatable SHA256. - Cold PRE_INSERT and internal_auto_increment now carry policy from their already-resolved TableDef/relation. A physical-table-ID-bound hint avoids re-reading mo_tables for those paths, including default policy. A stale/mismatched hint (including table-ID refresh/TRUNCATE) falls back to durable discovery; size/config/protocol checks remain. Table-ID-only callers without authoritative metadata still use the catalog lookup. - Empty-cache observation deliberately retains a fresh allocator offset read. Another CN can advance the watermark without changing local cache state; caching the last local offset would break the existing cross-CN observation regression. We do not introduce a distributed invalidation protocol or claim all observation SQL has been eliminated. - Real SQL cold metadata comparison: 1024 empty default-policy tables, three passes through GetColumns without allocator-cache reuse, median **2.977s without typed policy → 0.516s with typed policy** (~82.7% lower). DDL excluded; same embedded fixture, not an isolated production or full end-to-end benchmark. Unknown-ID fallback costs remain. No permanent heavyweight test fixture or benchmark scratch source added. - Complete incrservice/preinsert/function/mysql owning tests, incrservice/preinsert race, changed-package lint and two-CN public lifecycle passed. Handwritten Go changed-line coverage **15/15 (100%)**, combining owning/public profiles; grammar rejection is separately covered by parser/public SQL tests. Real mo-tester comparison passed **92/92 twice**, with zero ignored/abnormal statements and verified teardown. ### Latest merge and test follow-up Merged upstream through `77dbf54644`. Upstream V64 now belongs to typed BIN/CONV; **AUTO_ID_CACHE requires V65**. Parser conflict resolved by reproducible repository regeneration. A locally reproduced cross-CN lifecycle assertion read stale metadata immediately after ALTER; the test now waits for the writer commit to be replayed on the reader and advances the reader transaction frontier. Assertions are unchanged; no sleeps, retries, skips or timeout increases. Complete incrservice/compile/mysql/queryservice-client/optools tests and targeted lint passed. Public lifecycle passed normally and under race after the causal fence. Manual production gate changes have 2/2 executable lines covered. The failed Linux run hit its overall race-suite budget; upstream fixture/tooling improvements are included, but a successful new full CI run is still needed to establish that the budget is met. ### CI wait-budget regression follow-up Merged upstream through `4f9d170a22`; CACHE remains V65. Regenerated the parser conflict with repository tooling (repeatable SHA256). Run 34605879932 failed in `TestDiskCacheReadSharesWaitBudgetAcrossEntries/distinct_ranges`, not at the overall runner budget. Its 500ms wall-clock assertion expired under race load. The test now owns its entire fixture/channels/timers inside `testing/synctest`, retains both 64-entry scenarios and the 500ms deadline, and additionally asserts exactly one shared 20ms virtual wait budget. A temporary per-path-budget-reset mutation failed both scenarios and was reverted; no product wait behavior was changed. The exact test passed 100 race repetitions, the complete fileservice package passed normally and under race, and fileservice lint plus mysql/compile owning tests and public AUTO_ID_CACHE lifecycle passed. No sleeps, skips, retries, or deadline increases were introduced. ### Latest conflict/CI follow-up (`e7837e0b32`) Merged main through `887576e6b8`; upstream owns V65/V66, so the current AUTO_ID_CACHE gate is **V67**. Protobuf conflicts were resolved by repeatable repository generation. Upstream #28769 fixes the JSON ColumnBuffer fixture that failed UT/coverage. Complete vectorindex tests and race, incrservice/compile/plan/pb-plan owning tests and public AUTO_ID_CACHE lifecycle passed. **Unresolved CI diagnostic:** the proxy ALTER BVT originally failed because deleteTable received two catalog rowids for one account/database/name during repeated ALTER COPY in a transaction. The unchanged original case passes 95/95 twice on a local two-CN direct-connection fixture, but that does not establish the proxy failure is fixed. No expected-result changes, retries or arbitrary row selection were introduced; this root cause remains open. ### Latest follow-up (`79efd5ed10`) Merged main through `be30a70fe5`. The current AUTO_ID_CACHE gate is **V69**, preserving upstream V67 timezone and V68 GROUP_CONCAT contracts. Parser regeneration is reproducible; the equivalent upstream port-probe fix replaces duplicate local fixtures. Complete incrservice/compile/mysql tests with coverage, port race tests x100, and public AUTO_ID_CACHE lifecycle passed. Run 34807638541 passed UT, SCA, UT coverage and Proxy BVT. Its Pessimistic BVT never started: setup-java exhausted its existing attempts downloading Java with HTTP 500. Aggregate coverage was blocked by that missing producer, not by a coverage threshold. No product/workflow workarounds or weakened tests were introduced. This push triggers a fresh run; fresh CI results have not been monitored or claimed. ### Latest conflict-only follow-up (`32374c048d`) Merged main through `a72a224ce8`. The current AUTO_ID_CACHE gate is **V70**, preserving upstream V69 bounded RANK. Protobuf was regenerated twice with identical hashes. AUTO_ID_CACHE gate tests, complete incrservice/compile/pb-plan tests, and public lifecycle passed. Compilation initially exceeded the local command budget; lowering parallelism unblocked validation. Existing Parquet fanout tests failed with GOMAXPROCS=2 and the complete compile package passed with GOMAXPROCS=4; no assertions were changed. No CI checks were queried or monitored in this conflict-only follow-up. ### Latest review follow-up (`7bbab4c1cf`) Addresses the two P2 performance comments in review 5197965391: - All definition-owning Reset/SetOffset production callers (TRUNCATE, in-place/copy ALTER, CLONE and LOAD TABLE) now carry physically bound policy hints. Truly unknown or mismatched table IDs retain durable fallback; no global metadata cache is added. - Empty demand-only observations use a fresh `(table_id, col_name)` offset/step point query rather than reading policy and the complete column list. Private transaction ownership, committed fresh snapshots, errors/overflow and no-reservation semantics remain intact. No stale observation cache or distributed invalidation protocol is introduced. Validation: complete incrservice/compile/table_clone/frontend tests with coverage; complete incrservice race; strict DDL context and fresh-observation SQL regressions; public two-CN lifecycle; incremental lint and diff check. Handwritten changed-code coverage: **51/52 = 98.08%**. Mock generation is reproducible. Real 1024-empty-table store-read benchmark, three-pass medians: catalog fallback **951.706ms**, policy hint **204.496ms**, offset/step point query **133.514ms**. DDL/cleanup excluded, no allocator reservation/cache reuse. This is store-read cost, not end-to-end DDL/SHOW throughput. Every empty observation intentionally still executes one fresh SQL query. Fresh CI has not been monitored; no reviewer replies or Resolve actions were posted. ### Latest conflict-only follow-up (`02dde94931`) Merged main through `2ea4ec2e6e`. AUTO_ID_CACHE now uses **V73**, preserving upstream V70 row-dependent CONV bases, V71 checked integer arithmetic, and V72 corrected IP semantics. The CREATE conflict retains both the AUTO_ID_CACHE publication gate and upstream persisted-IP gates for main/index table definitions. Wire opcode and protobuf field numbers are unchanged. Complete incrservice and compile tests, V72-reject/V73-accept sender/receiver boundaries, incremental lint, and the public two-CN AUTO_ID_CACHE lifecycle passed. Initial compile and lifecycle attempts hit local temporary-directory capacity/path-length environment failures; both passed using task-owned temporary directories, which were removed. No tests were weakened. Fresh CI has not been monitored. ### Cross-CN observation follow-up (`0dd58f854a`) Addresses review 5205129331. A committed empty demand-only observation now acquires the engine TN-ordered `LogtailReadBarrier`, then starts the allocator point-read transaction with the returned applied frontier as `MinCommittedTS`. This prevents default sacrificing-freshness from selecting a pre-frontier snapshot on the observing CN. Private uncommitted CREATE observations continue to use their owner transaction and do not acquire an external barrier. Missing capability, cancellation and barrier errors fail closed; there are no sleeps, retries, stale caches or allocator reservations. Deterministic tests block the barrier and prove SQL cannot start before release, verify the exact frontier is carried into executor options, preserve private/committed transaction behavior, and cover cancellation/missing capability plus the CN adapter. Complete incrservice/cnservice tests, focused race, incremental lint, and the public immediate cross-CN lifecycle passed. Handwritten changed-code coverage: **24/26 = 92.31%**. The earlier point-query benchmark is now documented only as pre-barrier SQL-shape evidence, not current end-to-end latency. Fresh CI has not been monitored; no review reply or Resolve mutation was posted. ### Metadata observation follow-up (`965157e10b`) Addresses review 5208589585. One vectorized `internal_auto_increment` evaluation now owns a statement-local observation scope: all table point reads share one TN-ordered frontier and retain that frontier as `MinCommittedTS`, while allocator offsets are never cached. Distinct evaluations acquire new frontiers. The scope is concurrency-safe and retains a barrier error consistently without starting SQL. This reduces the external barrier count from O(tables) to one per vector evaluation; point queries remain keyed by `(table_id, col_name)` rather than introducing dynamic batch SQL. Reset also safely rebinds a known policy from the exact old physical ID to its replacement ID. A hint already bound to the replacement remains valid; unrelated hints are not trusted and retain durable fallback. Complete incrservice/function tests, public two-CN SQL lifecycle with dependency coverage, focused concurrent race, incremental lint and diff checks passed. Combined handwritten changed-code coverage: **16/20 = 80%**; the rebinding helper itself and old/new/unrelated cases are covered. No sleeps, retries, stale caches or review-thread mutations were introduced. Fresh CI has not been monitored. ### Latest conflict-only follow-up (`bf613fb0f1`) Merged main through `4cd720e0ce`. AUTO_ID_CACHE now uses **V74**, preserving upstream V73 widened DECIMAL SUM partial state. Local and remote sender/receiver gates reject V73 and accept V74; wire opcode and protobuf field numbers remain unchanged. This merge had only the protocol constant conflict and no generated-file conflict. Complete incrservice/compile tests, public two-CN lifecycle, incremental lint and diff checks passed. Fresh CI has not been monitored. ### Latest conflict/CI follow-up (`d45dc8cce9`) Merged main through `091825aac2`. AUTO_ID_CACHE now uses **V76**, preserving upstream V74 corrected numeric HEX identities and V75 persistent data-branch identity. The MySQL parser conflict was resolved by reproducible repository regeneration; local and remote AUTO_ID_CACHE boundaries reject V75 and accept V76, while wire opcode and protobuf field numbers remain unchanged. Run 34990282101 exposed a real empty-result cleanup race rather than a slow test: a drain-all Shuffle that never reached `Prepare` could still publish a shared-pool stopper. Under parallel cleanup this produced `shuffle pool too many stoppers!` panics, killed worker goroutines, and stranded the query until its 180-second deadline. Cleanup now publishes a stopper only for an operator that owns a holder acquired by `Prepare`. The regression fails with the ownership guard removed, passes under race 100 times, and `TestIssue28313EmptyRemoteDispatch` passes under race 5 times. Complete shuffle/incrservice/compile/parser owning tests, AUTO_ID_CACHE public lifecycle, targeted lint, coverage and diff checks passed. No timeout increase, retry, skip, or assertion weakening was introduced. Fresh CI has not been monitored. Approved by: @gouhongshen, @fengttt, @XuPeng-SH, @aunjgr, @aptend, @iamlinjunhong
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
) ## What type of PR is this? - [x] Test and CI ## Which issue(s) this PR fixes: Related issue: matrixorigin#28039 (the JSON payload validation change that exposed this stale fixture). matrixorigin#28039 ## What this PR does / why we need it: `T_json` vector payloads use ByteJson's binary storage format, not raw JSON text. The `AppendColumnBuffer` UT built its JSON values from arbitrary text and began failing when vector admission validation was added. Parse the JSON fixture strings and marshal them into ByteJson storage bytes before building the `ColumnBuffer`. This changes only test fixture construction; production behavior and test coverage remain unchanged. Validation: `GOMAXPROCS=6 go test -p=1 ./pkg/vectorindex -run '^TestAppendColumnBuffer_AllTypes$' -count=1` (pass).
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
Adds opt-in, table-owned `AUTO_ID_CACHE` support while reusing the existing `ALTER TABLE ... AUTO_INCREMENT` and session increment/offset implementations. ### Behavior - `CREATE TABLE ... AUTO_ID_CACHE=0` (or omitted) inherits the existing CN allocation policy. - `AUTO_ID_CACHE=1` reserves only actual automatic-row demand, with no constructor, estimate, low-water, or concurrency-driven speculative reservation. It does **not** promise globally monotonic or gapless IDs. - Values `2..1000000` override the base raw reservation span; larger actual demand can enlarge a reservation. Non-default session series still do not background-prefetch. - Reject invalid, duplicate, out-of-range options and nonzero policies without a visible auto-increment column. `ALTER ... AUTO_ID_CACHE` is not supported. - Persist the policy in `SchemaExtra`, project it through `TableDef` and allocator columns, and preserve it across cold CN loading, SHOW CREATE, LIKE/COPY/CLONE, rename, TRUNCATE, dump/load, and restart. - Keep demand-only `CurrentValue` observation non-reserving and preserve the existing pre-generation allocation-timestamp probe and deferred generated-ID publication. ### Rollout boundary — approved option A The production configuration defaults to **disabled**: ```toml [cn.auto-increment] enable-auto-id-cache = true ``` Enable only after draining workloads, stopping all old CN/TN processes, and upgrading every role. **Mixed-version operation and old-node reentry are unsupported.** The new V67 check and appended PRE_INSERT wire marker provide local/transport rejection, not cluster-wide admission or proof of upgrade completion. Disabled nodes reject nonzero CREATE and allocator-cache construction/use instead of silently applying their defaults. SHOW retains the persisted policy. Existing independent `ALTER AUTO_INCREMENT` offset/epoch maintenance remains available and preserves the policy. Disabling is not data rollback; in-place downgrade with nonzero-policy tables is unsupported. The standalone, multi-CN, compose BVT examples and shared feature-test fixture explicitly opt in for fresh, same-version test clusters. No platform admission state machine, additional allocator table, background worker, or per-row capability RPC is introduced. This PR does not independently fix or close the separate REPLACE/IGNORE issues. ### Design and review The allocator/metadata design and rollout option A were approved before their respective implementation phases. Exact delivered revisions: - [AUTO_INCREMENT r4 design](https://github.com/ck89119/matrixone/blob/69552cf461a558e696826d2adaca03fdb13c652f/docs/design/CLAUDE_AUTO_INCREMENT_23371.md) - [AUTO_ID_CACHE rollout A/r1](https://github.com/ck89119/matrixone/blob/69552cf461a558e696826d2adaca03fdb13c652f/docs/design/CLAUDE_AUTO_ID_CACHE_ROLLOUT_23371.md) Self-review covered the complete change map, metadata readers/writers and recovery paths, ownership/cancellation/retirement, bounds, protocol rejection, and delivery artifacts. Generated parser/protobuf files were regenerated with repository tools and reproduced identical SHA256 hashes; most diff volume is generated parser tables. ### Validation Local validation used darwin/arm64, Go 1.26.4, and the repository `mo-cgo-test` wrapper with matching native artifacts. - Owning packages passed: `incrservice`, `sql/plan`, `sql/parsers/...`, `sql/compile`, `pb/api`, `pb/plan`, `vm`, `vm/engine`, the entire `disttae` package, `disttae/cache`, `tae/catalog`, `cnservice`, and `embed`. - Five individually selected race tests each passed **100 repetitions** after duration-based budget selection: concurrent cache demand, cancellation/retirement, concurrent session series, cold services/probes, and runtime gate cleanup. Entire `incrservice` and `sql/compile` packages also passed once under `-race`. - Changed-line coverage: **250/271 = 92.25%**, mapped from Go coverage blocks, excluding generated files and tests; this is not whole-package or branch coverage. - `TestAutoIDCachePublicLifecycle`: real two-CN cold loading, DDL lifecycle, rename, and public stage/object dump/load passed. - `TestAutoIDCacheRestartAndDisabledNode`: permanent isolated-cluster test passed through full shutdown, disabled restart, rejection/no-partial-DDL checks, and enabled restart with the expected next ID. - Real mo-tester BVT: generated/reviewed `.result`, then **67/67 twice on the same instance**, with zero failures/ignored/abnormal statements and independently verified database teardown between runs. Test services were closed. - Default one-row allocation benchmark, upstream vs feature, five 2-second samples each: median 1248 vs 1234 ns/op; both **0 B/op, 0 allocs/op**, approximately 0.0001 reservations/op. No material default hot-path regression observed; no claim of statistically significant speedup or zero cold-catalog overhead. - Before submission, synchronized `mo/main` through `3d22c694a8` and reran plan/compile owning tests and the public lifecycle test successfully. Other evidence is reused from `cd04bb4c1a` because the intervening SET/FIND_IN_SET change does not alter the validated CACHE protocol, allocator, or recovery paths. - `git diff --check` passed. TODOs, local logs, caches, and temporary harnesses are excluded. ### Review follow-up — transaction-owned observation and ALTER normalization Fixed in `5d72ca9e9d`, after merging upstream through `d3794ea964`: - Demand-only observation now runs in the actual table-cache owner: uncommitted CREATE uses its transaction, while committed caches use a fresh committed read. The lazy wrapper retains the delegate for the entire observation. No IDs are reserved by SHOW/information_schema queries. - After all ALTER COPY clauses are applied, clear the inherited policy only if the final definition has no visible auto-increment column. MODIFY/DROP now succeed; keeping or transferring the auto-increment attribute preserves the policy. Direct CREATE validation and truthful SHOW rendering remain unchanged. - Added pre-fix failing regressions, commit/rollback and lazy-owner coverage, final-definition/internal-CREATE controls, and real SHOW TABLE STATUS/information_schema plus MODIFY/DROP controls for policies 0/1/8. - Updated owning incrservice/plan/compile tests and public lifecycle passed. The two affected observation tests each passed 100 individually selected race repetitions; the entire incrservice package passed once under race. - Follow-up changed-line coverage: **19/22 = 86.36%** (Go block mapping, excluding generated files/tests). The earlier 92.25% above records the initial implementation, not this incremental fix. - Updated mo-tester result was regenerated and reviewed; normal comparison passed **89/89 twice on the same instance**, with zero ignored/abnormal statements and verified teardown. Services were closed. - The generated plan protobuf merge conflict was resolved by repository tooling; regeneration reproduced the same SHA256. No TODOs or local validation artifacts were committed. ### Upstream conflict resolution Merged `mo/main@d3e8ace` in `27707b0f93`. Preserve upstream V58 for binary-string/runtime-domain semantics; AUTO_ID_CACHE now requires **V59**, with unchanged wire opcodes, field numbers, and rollout contract. Both independent remote-pipeline gates remain intact. Tests explicitly reject CACHE at V58 and accept it at V59. Focused gates, complete incrservice/compile/process/plan/frontend tests, and the real two-CN public lifecycle all passed on this merge. The two executable lines changed by the manual conflict resolution are covered (2/2); this is not a coverage claim for all incoming upstream code. Earlier unchanged allocator/race/BVT evidence is reused rather than reported as newly executed. The [updated rollout document](https://github.com/ck89119/matrixone/blob/27707b0f93fbc52b2b1c6b227fbc3389159cfa4b/docs/design/CLAUDE_AUTO_ID_CACHE_ROLLOUT_23371.md) records the protocol-number reassignment; the earlier design links above preserve the original approved revision. ### SCA follow-up (535269d) Merged upstream through `401b967dc1`, including matrixorigin#28555, which removes the unused CDC helper reported by SCA. No lint suppression was added. Upstream now owns V59 for FORMAT; AUTO_ID_CACHE therefore requires **V60**, with unchanged opcode/field numbers and rollout contract. Latest-version and dedicated boundary assertions were updated together. The rewritten remote branch was merged without force-pushing; its merge tree is identical to the locally validated tree. Repository-configured golangci-lint 2.6.2 passed for issues/incrservice/compile/queryservice-client. Complete incrservice/compile/queryservice-client/embed tests, the public AUTO_ID_CACHE lifecycle, and both CDC watermark ordering scenarios passed. This records targeted local validation, not a claim that the new full SCA run has passed. ### Latest review follow-up (`089c2e68cb`) Current protocol requirement is **V64**; earlier version numbers in the historical follow-ups are superseded. - Reject AUTO_ID_CACHE in PARTITION/SUBPARTITION option lists, including zero, at the shared parser boundary. Table-level placement and existing partition options remain supported. Added 12 parser counterexamples/controls, public SQL rejection with no published table, and BVT cases; regenerated the parser using repository tooling with repeatable SHA256. - Cold PRE_INSERT and internal_auto_increment now carry policy from their already-resolved TableDef/relation. A physical-table-ID-bound hint avoids re-reading mo_tables for those paths, including default policy. A stale/mismatched hint (including table-ID refresh/TRUNCATE) falls back to durable discovery; size/config/protocol checks remain. Table-ID-only callers without authoritative metadata still use the catalog lookup. - Empty-cache observation deliberately retains a fresh allocator offset read. Another CN can advance the watermark without changing local cache state; caching the last local offset would break the existing cross-CN observation regression. We do not introduce a distributed invalidation protocol or claim all observation SQL has been eliminated. - Real SQL cold metadata comparison: 1024 empty default-policy tables, three passes through GetColumns without allocator-cache reuse, median **2.977s without typed policy → 0.516s with typed policy** (~82.7% lower). DDL excluded; same embedded fixture, not an isolated production or full end-to-end benchmark. Unknown-ID fallback costs remain. No permanent heavyweight test fixture or benchmark scratch source added. - Complete incrservice/preinsert/function/mysql owning tests, incrservice/preinsert race, changed-package lint and two-CN public lifecycle passed. Handwritten Go changed-line coverage **15/15 (100%)**, combining owning/public profiles; grammar rejection is separately covered by parser/public SQL tests. Real mo-tester comparison passed **92/92 twice**, with zero ignored/abnormal statements and verified teardown. ### Latest merge and test follow-up Merged upstream through `77dbf54644`. Upstream V64 now belongs to typed BIN/CONV; **AUTO_ID_CACHE requires V65**. Parser conflict resolved by reproducible repository regeneration. A locally reproduced cross-CN lifecycle assertion read stale metadata immediately after ALTER; the test now waits for the writer commit to be replayed on the reader and advances the reader transaction frontier. Assertions are unchanged; no sleeps, retries, skips or timeout increases. Complete incrservice/compile/mysql/queryservice-client/optools tests and targeted lint passed. Public lifecycle passed normally and under race after the causal fence. Manual production gate changes have 2/2 executable lines covered. The failed Linux run hit its overall race-suite budget; upstream fixture/tooling improvements are included, but a successful new full CI run is still needed to establish that the budget is met. ### CI wait-budget regression follow-up Merged upstream through `4f9d170a22`; CACHE remains V65. Regenerated the parser conflict with repository tooling (repeatable SHA256). Run 34605879932 failed in `TestDiskCacheReadSharesWaitBudgetAcrossEntries/distinct_ranges`, not at the overall runner budget. Its 500ms wall-clock assertion expired under race load. The test now owns its entire fixture/channels/timers inside `testing/synctest`, retains both 64-entry scenarios and the 500ms deadline, and additionally asserts exactly one shared 20ms virtual wait budget. A temporary per-path-budget-reset mutation failed both scenarios and was reverted; no product wait behavior was changed. The exact test passed 100 race repetitions, the complete fileservice package passed normally and under race, and fileservice lint plus mysql/compile owning tests and public AUTO_ID_CACHE lifecycle passed. No sleeps, skips, retries, or deadline increases were introduced. ### Latest conflict/CI follow-up (`e7837e0b32`) Merged main through `887576e6b8`; upstream owns V65/V66, so the current AUTO_ID_CACHE gate is **V67**. Protobuf conflicts were resolved by repeatable repository generation. Upstream matrixorigin#28769 fixes the JSON ColumnBuffer fixture that failed UT/coverage. Complete vectorindex tests and race, incrservice/compile/plan/pb-plan owning tests and public AUTO_ID_CACHE lifecycle passed. **Unresolved CI diagnostic:** the proxy ALTER BVT originally failed because deleteTable received two catalog rowids for one account/database/name during repeated ALTER COPY in a transaction. The unchanged original case passes 95/95 twice on a local two-CN direct-connection fixture, but that does not establish the proxy failure is fixed. No expected-result changes, retries or arbitrary row selection were introduced; this root cause remains open. ### Latest follow-up (`79efd5ed10`) Merged main through `be30a70fe5`. The current AUTO_ID_CACHE gate is **V69**, preserving upstream V67 timezone and V68 GROUP_CONCAT contracts. Parser regeneration is reproducible; the equivalent upstream port-probe fix replaces duplicate local fixtures. Complete incrservice/compile/mysql tests with coverage, port race tests x100, and public AUTO_ID_CACHE lifecycle passed. Run 34807638541 passed UT, SCA, UT coverage and Proxy BVT. Its Pessimistic BVT never started: setup-java exhausted its existing attempts downloading Java with HTTP 500. Aggregate coverage was blocked by that missing producer, not by a coverage threshold. No product/workflow workarounds or weakened tests were introduced. This push triggers a fresh run; fresh CI results have not been monitored or claimed. ### Latest conflict-only follow-up (`32374c048d`) Merged main through `a72a224ce8`. The current AUTO_ID_CACHE gate is **V70**, preserving upstream V69 bounded RANK. Protobuf was regenerated twice with identical hashes. AUTO_ID_CACHE gate tests, complete incrservice/compile/pb-plan tests, and public lifecycle passed. Compilation initially exceeded the local command budget; lowering parallelism unblocked validation. Existing Parquet fanout tests failed with GOMAXPROCS=2 and the complete compile package passed with GOMAXPROCS=4; no assertions were changed. No CI checks were queried or monitored in this conflict-only follow-up. ### Latest review follow-up (`7bbab4c1cf`) Addresses the two P2 performance comments in review 5197965391: - All definition-owning Reset/SetOffset production callers (TRUNCATE, in-place/copy ALTER, CLONE and LOAD TABLE) now carry physically bound policy hints. Truly unknown or mismatched table IDs retain durable fallback; no global metadata cache is added. - Empty demand-only observations use a fresh `(table_id, col_name)` offset/step point query rather than reading policy and the complete column list. Private transaction ownership, committed fresh snapshots, errors/overflow and no-reservation semantics remain intact. No stale observation cache or distributed invalidation protocol is introduced. Validation: complete incrservice/compile/table_clone/frontend tests with coverage; complete incrservice race; strict DDL context and fresh-observation SQL regressions; public two-CN lifecycle; incremental lint and diff check. Handwritten changed-code coverage: **51/52 = 98.08%**. Mock generation is reproducible. Real 1024-empty-table store-read benchmark, three-pass medians: catalog fallback **951.706ms**, policy hint **204.496ms**, offset/step point query **133.514ms**. DDL/cleanup excluded, no allocator reservation/cache reuse. This is store-read cost, not end-to-end DDL/SHOW throughput. Every empty observation intentionally still executes one fresh SQL query. Fresh CI has not been monitored; no reviewer replies or Resolve actions were posted. ### Latest conflict-only follow-up (`02dde94931`) Merged main through `2ea4ec2e6e`. AUTO_ID_CACHE now uses **V73**, preserving upstream V70 row-dependent CONV bases, V71 checked integer arithmetic, and V72 corrected IP semantics. The CREATE conflict retains both the AUTO_ID_CACHE publication gate and upstream persisted-IP gates for main/index table definitions. Wire opcode and protobuf field numbers are unchanged. Complete incrservice and compile tests, V72-reject/V73-accept sender/receiver boundaries, incremental lint, and the public two-CN AUTO_ID_CACHE lifecycle passed. Initial compile and lifecycle attempts hit local temporary-directory capacity/path-length environment failures; both passed using task-owned temporary directories, which were removed. No tests were weakened. Fresh CI has not been monitored. ### Cross-CN observation follow-up (`0dd58f854a`) Addresses review 5205129331. A committed empty demand-only observation now acquires the engine TN-ordered `LogtailReadBarrier`, then starts the allocator point-read transaction with the returned applied frontier as `MinCommittedTS`. This prevents default sacrificing-freshness from selecting a pre-frontier snapshot on the observing CN. Private uncommitted CREATE observations continue to use their owner transaction and do not acquire an external barrier. Missing capability, cancellation and barrier errors fail closed; there are no sleeps, retries, stale caches or allocator reservations. Deterministic tests block the barrier and prove SQL cannot start before release, verify the exact frontier is carried into executor options, preserve private/committed transaction behavior, and cover cancellation/missing capability plus the CN adapter. Complete incrservice/cnservice tests, focused race, incremental lint, and the public immediate cross-CN lifecycle passed. Handwritten changed-code coverage: **24/26 = 92.31%**. The earlier point-query benchmark is now documented only as pre-barrier SQL-shape evidence, not current end-to-end latency. Fresh CI has not been monitored; no review reply or Resolve mutation was posted. ### Metadata observation follow-up (`965157e10b`) Addresses review 5208589585. One vectorized `internal_auto_increment` evaluation now owns a statement-local observation scope: all table point reads share one TN-ordered frontier and retain that frontier as `MinCommittedTS`, while allocator offsets are never cached. Distinct evaluations acquire new frontiers. The scope is concurrency-safe and retains a barrier error consistently without starting SQL. This reduces the external barrier count from O(tables) to one per vector evaluation; point queries remain keyed by `(table_id, col_name)` rather than introducing dynamic batch SQL. Reset also safely rebinds a known policy from the exact old physical ID to its replacement ID. A hint already bound to the replacement remains valid; unrelated hints are not trusted and retain durable fallback. Complete incrservice/function tests, public two-CN SQL lifecycle with dependency coverage, focused concurrent race, incremental lint and diff checks passed. Combined handwritten changed-code coverage: **16/20 = 80%**; the rebinding helper itself and old/new/unrelated cases are covered. No sleeps, retries, stale caches or review-thread mutations were introduced. Fresh CI has not been monitored. ### Latest conflict-only follow-up (`bf613fb0f1`) Merged main through `4cd720e0ce`. AUTO_ID_CACHE now uses **V74**, preserving upstream V73 widened DECIMAL SUM partial state. Local and remote sender/receiver gates reject V73 and accept V74; wire opcode and protobuf field numbers remain unchanged. This merge had only the protocol constant conflict and no generated-file conflict. Complete incrservice/compile tests, public two-CN lifecycle, incremental lint and diff checks passed. Fresh CI has not been monitored. ### Latest conflict/CI follow-up (`d45dc8cce9`) Merged main through `091825aac2`. AUTO_ID_CACHE now uses **V76**, preserving upstream V74 corrected numeric HEX identities and V75 persistent data-branch identity. The MySQL parser conflict was resolved by reproducible repository regeneration; local and remote AUTO_ID_CACHE boundaries reject V75 and accept V76, while wire opcode and protobuf field numbers remain unchanged. Run 34990282101 exposed a real empty-result cleanup race rather than a slow test: a drain-all Shuffle that never reached `Prepare` could still publish a shared-pool stopper. Under parallel cleanup this produced `shuffle pool too many stoppers!` panics, killed worker goroutines, and stranded the query until its 180-second deadline. Cleanup now publishes a stopper only for an operator that owns a holder acquired by `Prepare`. The regression fails with the ownership guard removed, passes under race 100 times, and `TestIssue28313EmptyRemoteDispatch` passes under race 5 times. Complete shuffle/incrservice/compile/parser owning tests, AUTO_ID_CACHE public lifecycle, targeted lint, coverage and diff checks passed. No timeout increase, retry, skip, or assertion weakening was introduced. Fresh CI has not been monitored. Approved by: @gouhongshen, @fengttt, @XuPeng-SH, @aunjgr, @aptend, @iamlinjunhong
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
) ## What type of PR is this? - [x] Test and CI ## Which issue(s) this PR fixes: Related issue: matrixorigin#28039 (the JSON payload validation change that exposed this stale fixture). matrixorigin#28039 ## What this PR does / why we need it: `T_json` vector payloads use ByteJson's binary storage format, not raw JSON text. The `AppendColumnBuffer` UT built its JSON values from arbitrary text and began failing when vector admission validation was added. Parse the JSON fixture strings and marshal them into ByteJson storage bytes before building the `ColumnBuffer`. This changes only test fixture construction; production behavior and test coverage remain unchanged. Validation: `GOMAXPROCS=6 go test -p=1 ./pkg/vectorindex -run '^TestAppendColumnBuffer_AllTypes$' -count=1` (pass).
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
) ## What type of PR is this? - [x] Test and CI ## Which issue(s) this PR fixes: Related issue: matrixorigin#28039 (the JSON payload validation change that exposed this stale fixture). matrixorigin#28039 ## What this PR does / why we need it: `T_json` vector payloads use ByteJson's binary storage format, not raw JSON text. The `AppendColumnBuffer` UT built its JSON values from arbitrary text and began failing when vector admission validation was added. Parse the JSON fixture strings and marshal them into ByteJson storage bytes before building the `ColumnBuffer`. This changes only test fixture construction; production behavior and test coverage remain unchanged. Validation: `GOMAXPROCS=6 go test -p=1 ./pkg/vectorindex -run '^TestAppendColumnBuffer_AllTypes$' -count=1` (pass).
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
Adds opt-in, table-owned `AUTO_ID_CACHE` support while reusing the existing `ALTER TABLE ... AUTO_INCREMENT` and session increment/offset implementations. ### Behavior - `CREATE TABLE ... AUTO_ID_CACHE=0` (or omitted) inherits the existing CN allocation policy. - `AUTO_ID_CACHE=1` reserves only actual automatic-row demand, with no constructor, estimate, low-water, or concurrency-driven speculative reservation. It does **not** promise globally monotonic or gapless IDs. - Values `2..1000000` override the base raw reservation span; larger actual demand can enlarge a reservation. Non-default session series still do not background-prefetch. - Reject invalid, duplicate, out-of-range options and nonzero policies without a visible auto-increment column. `ALTER ... AUTO_ID_CACHE` is not supported. - Persist the policy in `SchemaExtra`, project it through `TableDef` and allocator columns, and preserve it across cold CN loading, SHOW CREATE, LIKE/COPY/CLONE, rename, TRUNCATE, dump/load, and restart. - Keep demand-only `CurrentValue` observation non-reserving and preserve the existing pre-generation allocation-timestamp probe and deferred generated-ID publication. ### Rollout boundary — approved option A The production configuration defaults to **disabled**: ```toml [cn.auto-increment] enable-auto-id-cache = true ``` Enable only after draining workloads, stopping all old CN/TN processes, and upgrading every role. **Mixed-version operation and old-node reentry are unsupported.** The new V67 check and appended PRE_INSERT wire marker provide local/transport rejection, not cluster-wide admission or proof of upgrade completion. Disabled nodes reject nonzero CREATE and allocator-cache construction/use instead of silently applying their defaults. SHOW retains the persisted policy. Existing independent `ALTER AUTO_INCREMENT` offset/epoch maintenance remains available and preserves the policy. Disabling is not data rollback; in-place downgrade with nonzero-policy tables is unsupported. The standalone, multi-CN, compose BVT examples and shared feature-test fixture explicitly opt in for fresh, same-version test clusters. No platform admission state machine, additional allocator table, background worker, or per-row capability RPC is introduced. This PR does not independently fix or close the separate REPLACE/IGNORE issues. ### Design and review The allocator/metadata design and rollout option A were approved before their respective implementation phases. Exact delivered revisions: - [AUTO_INCREMENT r4 design](https://github.com/ck89119/matrixone/blob/69552cf461a558e696826d2adaca03fdb13c652f/docs/design/CLAUDE_AUTO_INCREMENT_23371.md) - [AUTO_ID_CACHE rollout A/r1](https://github.com/ck89119/matrixone/blob/69552cf461a558e696826d2adaca03fdb13c652f/docs/design/CLAUDE_AUTO_ID_CACHE_ROLLOUT_23371.md) Self-review covered the complete change map, metadata readers/writers and recovery paths, ownership/cancellation/retirement, bounds, protocol rejection, and delivery artifacts. Generated parser/protobuf files were regenerated with repository tools and reproduced identical SHA256 hashes; most diff volume is generated parser tables. ### Validation Local validation used darwin/arm64, Go 1.26.4, and the repository `mo-cgo-test` wrapper with matching native artifacts. - Owning packages passed: `incrservice`, `sql/plan`, `sql/parsers/...`, `sql/compile`, `pb/api`, `pb/plan`, `vm`, `vm/engine`, the entire `disttae` package, `disttae/cache`, `tae/catalog`, `cnservice`, and `embed`. - Five individually selected race tests each passed **100 repetitions** after duration-based budget selection: concurrent cache demand, cancellation/retirement, concurrent session series, cold services/probes, and runtime gate cleanup. Entire `incrservice` and `sql/compile` packages also passed once under `-race`. - Changed-line coverage: **250/271 = 92.25%**, mapped from Go coverage blocks, excluding generated files and tests; this is not whole-package or branch coverage. - `TestAutoIDCachePublicLifecycle`: real two-CN cold loading, DDL lifecycle, rename, and public stage/object dump/load passed. - `TestAutoIDCacheRestartAndDisabledNode`: permanent isolated-cluster test passed through full shutdown, disabled restart, rejection/no-partial-DDL checks, and enabled restart with the expected next ID. - Real mo-tester BVT: generated/reviewed `.result`, then **67/67 twice on the same instance**, with zero failures/ignored/abnormal statements and independently verified database teardown between runs. Test services were closed. - Default one-row allocation benchmark, upstream vs feature, five 2-second samples each: median 1248 vs 1234 ns/op; both **0 B/op, 0 allocs/op**, approximately 0.0001 reservations/op. No material default hot-path regression observed; no claim of statistically significant speedup or zero cold-catalog overhead. - Before submission, synchronized `mo/main` through `3d22c694a8` and reran plan/compile owning tests and the public lifecycle test successfully. Other evidence is reused from `cd04bb4c1a` because the intervening SET/FIND_IN_SET change does not alter the validated CACHE protocol, allocator, or recovery paths. - `git diff --check` passed. TODOs, local logs, caches, and temporary harnesses are excluded. ### Review follow-up — transaction-owned observation and ALTER normalization Fixed in `5d72ca9e9d`, after merging upstream through `d3794ea964`: - Demand-only observation now runs in the actual table-cache owner: uncommitted CREATE uses its transaction, while committed caches use a fresh committed read. The lazy wrapper retains the delegate for the entire observation. No IDs are reserved by SHOW/information_schema queries. - After all ALTER COPY clauses are applied, clear the inherited policy only if the final definition has no visible auto-increment column. MODIFY/DROP now succeed; keeping or transferring the auto-increment attribute preserves the policy. Direct CREATE validation and truthful SHOW rendering remain unchanged. - Added pre-fix failing regressions, commit/rollback and lazy-owner coverage, final-definition/internal-CREATE controls, and real SHOW TABLE STATUS/information_schema plus MODIFY/DROP controls for policies 0/1/8. - Updated owning incrservice/plan/compile tests and public lifecycle passed. The two affected observation tests each passed 100 individually selected race repetitions; the entire incrservice package passed once under race. - Follow-up changed-line coverage: **19/22 = 86.36%** (Go block mapping, excluding generated files/tests). The earlier 92.25% above records the initial implementation, not this incremental fix. - Updated mo-tester result was regenerated and reviewed; normal comparison passed **89/89 twice on the same instance**, with zero ignored/abnormal statements and verified teardown. Services were closed. - The generated plan protobuf merge conflict was resolved by repository tooling; regeneration reproduced the same SHA256. No TODOs or local validation artifacts were committed. ### Upstream conflict resolution Merged `mo/main@d3e8ace` in `27707b0f93`. Preserve upstream V58 for binary-string/runtime-domain semantics; AUTO_ID_CACHE now requires **V59**, with unchanged wire opcodes, field numbers, and rollout contract. Both independent remote-pipeline gates remain intact. Tests explicitly reject CACHE at V58 and accept it at V59. Focused gates, complete incrservice/compile/process/plan/frontend tests, and the real two-CN public lifecycle all passed on this merge. The two executable lines changed by the manual conflict resolution are covered (2/2); this is not a coverage claim for all incoming upstream code. Earlier unchanged allocator/race/BVT evidence is reused rather than reported as newly executed. The [updated rollout document](https://github.com/ck89119/matrixone/blob/27707b0f93fbc52b2b1c6b227fbc3389159cfa4b/docs/design/CLAUDE_AUTO_ID_CACHE_ROLLOUT_23371.md) records the protocol-number reassignment; the earlier design links above preserve the original approved revision. ### SCA follow-up (535269d) Merged upstream through `401b967dc1`, including matrixorigin#28555, which removes the unused CDC helper reported by SCA. No lint suppression was added. Upstream now owns V59 for FORMAT; AUTO_ID_CACHE therefore requires **V60**, with unchanged opcode/field numbers and rollout contract. Latest-version and dedicated boundary assertions were updated together. The rewritten remote branch was merged without force-pushing; its merge tree is identical to the locally validated tree. Repository-configured golangci-lint 2.6.2 passed for issues/incrservice/compile/queryservice-client. Complete incrservice/compile/queryservice-client/embed tests, the public AUTO_ID_CACHE lifecycle, and both CDC watermark ordering scenarios passed. This records targeted local validation, not a claim that the new full SCA run has passed. ### Latest review follow-up (`089c2e68cb`) Current protocol requirement is **V64**; earlier version numbers in the historical follow-ups are superseded. - Reject AUTO_ID_CACHE in PARTITION/SUBPARTITION option lists, including zero, at the shared parser boundary. Table-level placement and existing partition options remain supported. Added 12 parser counterexamples/controls, public SQL rejection with no published table, and BVT cases; regenerated the parser using repository tooling with repeatable SHA256. - Cold PRE_INSERT and internal_auto_increment now carry policy from their already-resolved TableDef/relation. A physical-table-ID-bound hint avoids re-reading mo_tables for those paths, including default policy. A stale/mismatched hint (including table-ID refresh/TRUNCATE) falls back to durable discovery; size/config/protocol checks remain. Table-ID-only callers without authoritative metadata still use the catalog lookup. - Empty-cache observation deliberately retains a fresh allocator offset read. Another CN can advance the watermark without changing local cache state; caching the last local offset would break the existing cross-CN observation regression. We do not introduce a distributed invalidation protocol or claim all observation SQL has been eliminated. - Real SQL cold metadata comparison: 1024 empty default-policy tables, three passes through GetColumns without allocator-cache reuse, median **2.977s without typed policy → 0.516s with typed policy** (~82.7% lower). DDL excluded; same embedded fixture, not an isolated production or full end-to-end benchmark. Unknown-ID fallback costs remain. No permanent heavyweight test fixture or benchmark scratch source added. - Complete incrservice/preinsert/function/mysql owning tests, incrservice/preinsert race, changed-package lint and two-CN public lifecycle passed. Handwritten Go changed-line coverage **15/15 (100%)**, combining owning/public profiles; grammar rejection is separately covered by parser/public SQL tests. Real mo-tester comparison passed **92/92 twice**, with zero ignored/abnormal statements and verified teardown. ### Latest merge and test follow-up Merged upstream through `77dbf54644`. Upstream V64 now belongs to typed BIN/CONV; **AUTO_ID_CACHE requires V65**. Parser conflict resolved by reproducible repository regeneration. A locally reproduced cross-CN lifecycle assertion read stale metadata immediately after ALTER; the test now waits for the writer commit to be replayed on the reader and advances the reader transaction frontier. Assertions are unchanged; no sleeps, retries, skips or timeout increases. Complete incrservice/compile/mysql/queryservice-client/optools tests and targeted lint passed. Public lifecycle passed normally and under race after the causal fence. Manual production gate changes have 2/2 executable lines covered. The failed Linux run hit its overall race-suite budget; upstream fixture/tooling improvements are included, but a successful new full CI run is still needed to establish that the budget is met. ### CI wait-budget regression follow-up Merged upstream through `4f9d170a22`; CACHE remains V65. Regenerated the parser conflict with repository tooling (repeatable SHA256). Run 34605879932 failed in `TestDiskCacheReadSharesWaitBudgetAcrossEntries/distinct_ranges`, not at the overall runner budget. Its 500ms wall-clock assertion expired under race load. The test now owns its entire fixture/channels/timers inside `testing/synctest`, retains both 64-entry scenarios and the 500ms deadline, and additionally asserts exactly one shared 20ms virtual wait budget. A temporary per-path-budget-reset mutation failed both scenarios and was reverted; no product wait behavior was changed. The exact test passed 100 race repetitions, the complete fileservice package passed normally and under race, and fileservice lint plus mysql/compile owning tests and public AUTO_ID_CACHE lifecycle passed. No sleeps, skips, retries, or deadline increases were introduced. ### Latest conflict/CI follow-up (`e7837e0b32`) Merged main through `887576e6b8`; upstream owns V65/V66, so the current AUTO_ID_CACHE gate is **V67**. Protobuf conflicts were resolved by repeatable repository generation. Upstream matrixorigin#28769 fixes the JSON ColumnBuffer fixture that failed UT/coverage. Complete vectorindex tests and race, incrservice/compile/plan/pb-plan owning tests and public AUTO_ID_CACHE lifecycle passed. **Unresolved CI diagnostic:** the proxy ALTER BVT originally failed because deleteTable received two catalog rowids for one account/database/name during repeated ALTER COPY in a transaction. The unchanged original case passes 95/95 twice on a local two-CN direct-connection fixture, but that does not establish the proxy failure is fixed. No expected-result changes, retries or arbitrary row selection were introduced; this root cause remains open. ### Latest follow-up (`79efd5ed10`) Merged main through `be30a70fe5`. The current AUTO_ID_CACHE gate is **V69**, preserving upstream V67 timezone and V68 GROUP_CONCAT contracts. Parser regeneration is reproducible; the equivalent upstream port-probe fix replaces duplicate local fixtures. Complete incrservice/compile/mysql tests with coverage, port race tests x100, and public AUTO_ID_CACHE lifecycle passed. Run 34807638541 passed UT, SCA, UT coverage and Proxy BVT. Its Pessimistic BVT never started: setup-java exhausted its existing attempts downloading Java with HTTP 500. Aggregate coverage was blocked by that missing producer, not by a coverage threshold. No product/workflow workarounds or weakened tests were introduced. This push triggers a fresh run; fresh CI results have not been monitored or claimed. ### Latest conflict-only follow-up (`32374c048d`) Merged main through `a72a224ce8`. The current AUTO_ID_CACHE gate is **V70**, preserving upstream V69 bounded RANK. Protobuf was regenerated twice with identical hashes. AUTO_ID_CACHE gate tests, complete incrservice/compile/pb-plan tests, and public lifecycle passed. Compilation initially exceeded the local command budget; lowering parallelism unblocked validation. Existing Parquet fanout tests failed with GOMAXPROCS=2 and the complete compile package passed with GOMAXPROCS=4; no assertions were changed. No CI checks were queried or monitored in this conflict-only follow-up. ### Latest review follow-up (`7bbab4c1cf`) Addresses the two P2 performance comments in review 5197965391: - All definition-owning Reset/SetOffset production callers (TRUNCATE, in-place/copy ALTER, CLONE and LOAD TABLE) now carry physically bound policy hints. Truly unknown or mismatched table IDs retain durable fallback; no global metadata cache is added. - Empty demand-only observations use a fresh `(table_id, col_name)` offset/step point query rather than reading policy and the complete column list. Private transaction ownership, committed fresh snapshots, errors/overflow and no-reservation semantics remain intact. No stale observation cache or distributed invalidation protocol is introduced. Validation: complete incrservice/compile/table_clone/frontend tests with coverage; complete incrservice race; strict DDL context and fresh-observation SQL regressions; public two-CN lifecycle; incremental lint and diff check. Handwritten changed-code coverage: **51/52 = 98.08%**. Mock generation is reproducible. Real 1024-empty-table store-read benchmark, three-pass medians: catalog fallback **951.706ms**, policy hint **204.496ms**, offset/step point query **133.514ms**. DDL/cleanup excluded, no allocator reservation/cache reuse. This is store-read cost, not end-to-end DDL/SHOW throughput. Every empty observation intentionally still executes one fresh SQL query. Fresh CI has not been monitored; no reviewer replies or Resolve actions were posted. ### Latest conflict-only follow-up (`02dde94931`) Merged main through `2ea4ec2e6e`. AUTO_ID_CACHE now uses **V73**, preserving upstream V70 row-dependent CONV bases, V71 checked integer arithmetic, and V72 corrected IP semantics. The CREATE conflict retains both the AUTO_ID_CACHE publication gate and upstream persisted-IP gates for main/index table definitions. Wire opcode and protobuf field numbers are unchanged. Complete incrservice and compile tests, V72-reject/V73-accept sender/receiver boundaries, incremental lint, and the public two-CN AUTO_ID_CACHE lifecycle passed. Initial compile and lifecycle attempts hit local temporary-directory capacity/path-length environment failures; both passed using task-owned temporary directories, which were removed. No tests were weakened. Fresh CI has not been monitored. ### Cross-CN observation follow-up (`0dd58f854a`) Addresses review 5205129331. A committed empty demand-only observation now acquires the engine TN-ordered `LogtailReadBarrier`, then starts the allocator point-read transaction with the returned applied frontier as `MinCommittedTS`. This prevents default sacrificing-freshness from selecting a pre-frontier snapshot on the observing CN. Private uncommitted CREATE observations continue to use their owner transaction and do not acquire an external barrier. Missing capability, cancellation and barrier errors fail closed; there are no sleeps, retries, stale caches or allocator reservations. Deterministic tests block the barrier and prove SQL cannot start before release, verify the exact frontier is carried into executor options, preserve private/committed transaction behavior, and cover cancellation/missing capability plus the CN adapter. Complete incrservice/cnservice tests, focused race, incremental lint, and the public immediate cross-CN lifecycle passed. Handwritten changed-code coverage: **24/26 = 92.31%**. The earlier point-query benchmark is now documented only as pre-barrier SQL-shape evidence, not current end-to-end latency. Fresh CI has not been monitored; no review reply or Resolve mutation was posted. ### Metadata observation follow-up (`965157e10b`) Addresses review 5208589585. One vectorized `internal_auto_increment` evaluation now owns a statement-local observation scope: all table point reads share one TN-ordered frontier and retain that frontier as `MinCommittedTS`, while allocator offsets are never cached. Distinct evaluations acquire new frontiers. The scope is concurrency-safe and retains a barrier error consistently without starting SQL. This reduces the external barrier count from O(tables) to one per vector evaluation; point queries remain keyed by `(table_id, col_name)` rather than introducing dynamic batch SQL. Reset also safely rebinds a known policy from the exact old physical ID to its replacement ID. A hint already bound to the replacement remains valid; unrelated hints are not trusted and retain durable fallback. Complete incrservice/function tests, public two-CN SQL lifecycle with dependency coverage, focused concurrent race, incremental lint and diff checks passed. Combined handwritten changed-code coverage: **16/20 = 80%**; the rebinding helper itself and old/new/unrelated cases are covered. No sleeps, retries, stale caches or review-thread mutations were introduced. Fresh CI has not been monitored. ### Latest conflict-only follow-up (`bf613fb0f1`) Merged main through `4cd720e0ce`. AUTO_ID_CACHE now uses **V74**, preserving upstream V73 widened DECIMAL SUM partial state. Local and remote sender/receiver gates reject V73 and accept V74; wire opcode and protobuf field numbers remain unchanged. This merge had only the protocol constant conflict and no generated-file conflict. Complete incrservice/compile tests, public two-CN lifecycle, incremental lint and diff checks passed. Fresh CI has not been monitored. ### Latest conflict/CI follow-up (`d45dc8cce9`) Merged main through `091825aac2`. AUTO_ID_CACHE now uses **V76**, preserving upstream V74 corrected numeric HEX identities and V75 persistent data-branch identity. The MySQL parser conflict was resolved by reproducible repository regeneration; local and remote AUTO_ID_CACHE boundaries reject V75 and accept V76, while wire opcode and protobuf field numbers remain unchanged. Run 34990282101 exposed a real empty-result cleanup race rather than a slow test: a drain-all Shuffle that never reached `Prepare` could still publish a shared-pool stopper. Under parallel cleanup this produced `shuffle pool too many stoppers!` panics, killed worker goroutines, and stranded the query until its 180-second deadline. Cleanup now publishes a stopper only for an operator that owns a holder acquired by `Prepare`. The regression fails with the ownership guard removed, passes under race 100 times, and `TestIssue28313EmptyRemoteDispatch` passes under race 5 times. Complete shuffle/incrservice/compile/parser owning tests, AUTO_ID_CACHE public lifecycle, targeted lint, coverage and diff checks passed. No timeout increase, retry, skip, or assertion weakening was introduced. Fresh CI has not been monitored. Approved by: @gouhongshen, @fengttt, @XuPeng-SH, @aunjgr, @aptend, @iamlinjunhong
This branch was previously deployed
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.
What type of PR is this?
Which issue(s) this PR fixes:
Related issue: #28039 (the JSON payload validation change that exposed this stale fixture).
#28039
What this PR does / why we need it:
T_jsonvector payloads use ByteJson's binary storage format, not raw JSON text. TheAppendColumnBufferUT built its JSON values from arbitrary text and began failing when vector admission validation was added. Parse the JSON fixture strings and marshal them into ByteJson storage bytes before building theColumnBuffer.This changes only test fixture construction; production behavior and test coverage remain unchanged.
Validation:
GOMAXPROCS=6 go test -p=1 ./pkg/vectorindex -run '^TestAppendColumnBuffer_AllTypes$' -count=1(pass).