Repository navigation
feat: unify column reads for schema evolution (PR 1) - #32989
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? |
|
This pull request is merged. |
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
This PR adds the read-layer foundation for metadata-only column addition, and I found no blocking defect. The new ColumnReadSpec machinery (virtual column metadata, frozen-default materialization, prune/aggregate/statistic integration) is gated behind the SchemaEvolved feature bit and the HasOriginDefault proto field, neither of which any production DDL in this PR sets — ADD/DROP still use COPY and buildCopyTableDef clears the flag — so all existing dense-table behavior is unchanged, which I verified path by path: MustGetColumn replaces unguarded ColumnMeta reads safely, ForeachVisibleObjects is called with a nil executor so the removed mutex in MaxAndMinValues/GetColumMetadataScanInfo was vestigial, MergeZM no-ops on uninited zone maps, the seek/filter error plumbing fails loud only for genuinely corrupt layouts, and primarySeqnum/NextColSeqnum computations are equivalent for dense layouts while fixing sparse rebuilds (rowid now reserved at SEQNUM_ROWID). The proto change is append-only and unknown-field tolerant in both directions. WAL replay fills roll back on allocation failure via append checkpoints, and tombstone reads correctly strip the data spec. There were no prior reviews or inline comments to deduplicate. Caveats: I could not execute the test suite here because this worktree lacks the built cgo/thirdparties prerequisites (the documented mo-cgo-test runner refused primary-worktree artifact reuse, plain go test fails compiling matrixone/cgo headers, and CGO_ENABLED=0 fails on mpool's C allocator); per the review constraints I did not build them, so test results are limited to the author's report of the focused suite passing on this same tree plus my gofmt/whitespace checks. Two non-blocking notes follow; the author's stated remaining multi-CN/upgrade/SQL-level QA stands as the main residual risk for the series.
P2 - Schema.ColumnReadSpec re-decodes every column default on each scan window and replay fill (pkg/vm/engine/tae/tables/mnode.go:257)
mnode.getDataWindowLocked calls readSchema.ColumnReadSpec() for every windowed memory-node scan, and missingWALColumns calls schema.ColumnReadSpec() for every replayed append batch that lacks a column. Each call unmarshals the plan.Default bytes of every column and rebuilds the bySeqnum map. Catalog schema versions are immutable per version, so the decoded spec could be memoized on the Schema (with the error returned once) to avoid repeated per-window decodes once schema-evolved tables go live in the next PR. Behavior is correct today and the cost only appears for feature-flagged tables, so this is non-blocking.
P2 - Unsupported frozen literals surface only as query-time internal errors (pkg/objectio/column_read_spec.go:414)
decodeReadDefault rejects scalar float16/bf16/float8/float4 literals (explicitly awaiting plan.Literal support) and mismatched literal/type combinations, and newColumnReadEntry stores the error to be raised only when a read materializes the value. Consequently a table whose frozen default is one of these forms will fail every scan with 'unsupported origin default' rather than failing at schema-definition time. Since no production DDL in this PR sets HasOriginDefault, exposure is limited to tests, but when PR 2 introduces the write path, validating origin defaults eagerly at ALTER/CREATE time would turn these into DDL errors instead of runtime query failures.
|
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: 4fd9920cc0beb63b7da5bb66e789d7b3c134cdc1
Assessment: request_changes
ColumnReadSpec gives readers a shared representation for physically absent columns. CN and TN still activate it differently, and positional WAL replay can leave the primary-key index out of sync with the row vectors when a default fill fails. The cross-subsystem refactor also needs the repository-required design record.
Model: gpt-6.2-sol / xhigh
Session: 01a1ee80-0d82-7030-a965-b51f496c3054 · slot 2 · generation 1
-
P2
pkg/vm/engine/tae/tables/appender.go:206: A positional WAL payload overwrites an existing row in a schema-evolved table, and filling a missing column returns an allocation or decoding error.
Impact: The old row survives in the vectors, but its primary-key index entry has already been removed. The failed operation leaves data and index state inconsistent.
Evidence: ApplyAppendAt deletes the old key before calling ApplyAppendAtLocked. The new fill code at mnode.go:400 stages and rolls back vector changes only. Stage the fallible fill before deleting keys, or restore the keys when the fill fails. Exercise the appender entry point in the failure test. -
P2
pkg/objectio/column_read_spec.go:68: A column definition carries HasOriginDefault before the table carries SchemaEvolved. TestColumnReadSpecTypes explicitly exercises this state.
Impact: CN resolves a missing physical column to the frozen value, while TN resolves the same schema and row to NULL. If this state reaches compaction, TN can materialize a different value from the one CN reads.
Evidence: NewColumnReadSpecFromTableDef accepts the annotation alone. Schema.ColumnReadSpec at pkg/vm/engine/tae/catalog/schema.go:192 returns nil until the feature bit is set. Use one activation rule for both readers, or enforce that annotation-only definitions cannot reach execution. This phase has no SQL DDL writer for that state. -
P2
pkg/objectio/column_read_spec.go:46: The schema-evolution series changes persisted metadata interpretation across catalog, object I/O, WAL replay, CN and TN reads, and query execution.
Impact: The required design record is missing from the frozen inputs. The PR description leaves the activation invariant, replay failure boundary, and validation against supported release artifacts open.
Evidence: The pinned .agents/skills/mo-dev/references/feature-design-review.md, sections 1 and 2, requires an accessible revisioned design for this scope, including split PRs. Link or extend a design record covering those decisions and how the staged rollout will verify them.
Validation:
-
Isolation preflight, frozen head and patch verification, tree identity, and git diff --check passed. See preflight.log, scope.log, and receipts 1795229174201929541-3 and 1795229174534621688-3.
-
The generated Go audit and descriptor comparison confirmed that the protobuf schema changes add only Default fields 4 and 5. See receipts 1795229735591414069-3 and 1795229785182633893-3.
-
The selected catalog and objectio tests reported terminal package passes on Go 1.27.1 before the broader command timed out. See focused-retry.jsonl and receipt 1795229800363450588-2.
Limitations:
-
The remaining package checks and the replay overlay reached foreground limits before test execution. The final diagnostic trace stopped at linking. See receipts 1795230185853198722-2, 1795230412688055571-2, and 1795230524813703445-2.
-
The findings rely on source flow and the completed objectio tests. The frozen upgrade CI jobs were skipped, and the review has no release-produced upgrade artifact or live multi-CN run with an evolved schema.
fengttt
left a comment
There was a problem hiding this comment.
I found that you, or your AI buddy, really like to make changes to proto/api etc. Are these change really necessary? Why do you need that? Most likely all these changes are not the right places.
|
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: 4fd9920cc0beb63b7da5bb66e789d7b3c134cdc1
Assessment: request_changes
Historical defaults belong in persisted column metadata because insert defaults can change later. The existing plan.Default envelope can carry that distinction, but the current target branch's catalog projections discard both new fields. This adds a finding to the prior same-head assessment.
Model: gpt-6.2-sol / xhigh
Session: 01a1ed86-9b09-7303-8d78-76024e7bf652 · slot 3 · generation 0
-
P2
proto/plan.proto:494: A CN rebuilds its catalog schema on the current target after a column definition carries a frozen default.
Impact: The published schema loses the historical default. A non-NULL frozen value can become NULL in CN reads while TN still reads the persisted value.
Evidence: At target cc2c82d,CatalogZeroDefaultclassifies a frozen NULL as an ordinary empty default, andCopyDefaultIntodrops both new fields from nonzero defaults. Both paths feednewCandidateSchemainpkg/vm/engine/disttae/cache/schema_candidate.go:66. Update the existing sharing and copy helpers to preserve the distinction, with a catalog projection test. -
P2
pkg/objectio/column_read_spec.go:68: A column hasHasOriginDefaultwhile its table lacksSchemaEvolved.
Impact: CN can read the frozen value while TN reads NULL for the same missing column. Compaction can materialize that difference.
Evidence: The CN constructor accepts the annotation alone.Schema.ColumnReadSpecatpkg/vm/engine/tae/catalog/schema.go:192requires the feature bit. Use one activation rule or enforce the invariant before either reader can receive the definition. -
P2
pkg/vm/engine/tae/tables/appender.go:206: A positional WAL append replaces an existing row and default filling fails.
Impact: The appender returns with the old row still in its vectors and its primary-key index entry removed.
Evidence:ApplyAppendAtdeletes the key before the new fallible fill atmnode.go:400. Stage the fill before changing keys or restore the keys on failure. Exercise the appender entry point in the failure test. -
P2
pkg/objectio/column_read_spec.go:46: The schema-evolution series changes persisted metadata interpretation across catalog publication, CN and TN reads, and WAL replay.
Impact: The required design record leaves the activation invariant, replay failure boundary, and release-artifact validation open.
Evidence: Sections 1 and 2 of the pinnedfeature-design-review.mdapply to the full series. Issue #33035 outlines the rollout, and the target's catalog-ownership design covers schema projection. Extend either design record to settle the missing contracts.
Validation:
-
Verified the frozen checkout, patch, whitespace, identical pinned policy, and all seven discussion entries. See scope.log and receipts 1795366899950304923-5 and 1795366951156923204-5.
-
An isolated probe using the candidate's generated
Defaultdeclaration and the target's two helper bodies reproduced both field losses. The legacy control passed. See default-projection.jsonl and receipt 1795366852912061279-5. -
Reused the same-head descriptor audit and terminal catalog and objectio package passes. The broader Go invocation timed out. See evidence-audit.log.
Limitations:
-
The projection probe exercised the helper bodies. No merged-cluster run or release-produced upgrade artifact was available.
-
PR 1 retains COPY for SQL ADD and DROP. The frozen-default failures affect the staged read contract when the new metadata is supplied. Ordinary WAL recovery aborts on the appender error, and persisted index corruption was not demonstrated.
fengttt
left a comment
There was a problem hiding this comment.
Need to go back to drawing board and redesign.
|
mo-bot review · Commit: discussion changed before publication |
|
mo-bot review · Commit: New discussion was assessed; the previous review remains unchanged. |
|
mo-bot review · Commit: New discussion was assessed; the previous review remains unchanged. |
4fd9920 to
bd712e3
Compare
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? |
|
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: 84fbaca77b5e881ac537cca0333b2bd8a50736e6
Assessment: request_changes
The shared, feature-gated NULL read specification reuses existing schema metadata, and the prior sparse-read, snapshot and replay concerns have corresponding fixes. One new cleanup path can block ordinary change-range recovery after a recoverable object-read failure.
Model: gpt-6.1-terra / max
Session: 01a21456-006d-7b41-b150-908a3e9d9152 · slot 3 · generation 6
- P2
pkg/vm/engine/disttae/logtailreplay/change_handle.go:1322: An unbounded change-range read prefetches multiple CN-created blocks; one returns a missing-file error while another read remains stalled.
Impact: The deferred cleanup waits for the other read without cancelling it. The missing-file error can be delayed until the caller’s deadline, or indefinitely without one, preventing Data Branch from starting its snapshot fallback. Ordinary tables are affected.
Evidence: The jobs receive the parent context at lines 1339–1342, while releasePrefetchedChangeBlocks waits in GetResult at line 4560 without cancelling sibling work. The isolated candidate probe in focused-tests-seeded.log received the missing-file error immediately but did not return until its 750 ms context expired; the existing appendable-object cancellation control passed. A temporary cancellation overlay made the CN probe pass. Cancel outstanding reads when a job fails, preserve the original error, and then drain their results for cleanup.
Validation:
-
Isolation preflight passed; receipt checks/1795772280079032978-3.json.
-
Targeted TAE restart, sparse-workspace, snapshot and pruning tests passed; receipt checks/1795773292730369001-2.json and remaining-tests.log.
-
The focused candidate run exited 1 because the new CN prefetch probe failed as described; the existing cancellation control and selected WAL, bitmap and column-spec tests passed. See checks/1795772965763899438-2.json and focused-tests-seeded.log.
-
The temporary modified-source cancellation control passed; receipt checks/1795773391759568388-2.json and prefetch-cancel-control.log.
-
The frozen CI snapshot reports successful x86 unit and two multi-CN BVT jobs. Both upgrade compatibility jobs were skipped.
-
The discussion audit accounted for all 23 indexed keys, and git diff --check passed.
Limitations:
-
The author’s stopped v4.2.9 retired-sequence fixture uses the TAE API directly and was not independently rerun. Its rejection is reflected in the source and unit test, but a supported SQL route to the same checkpoint state was not established.
-
The prefetch probe uses an isolated filesystem stub; it does not exercise a live remote object store or an end-to-end Data Branch recovery.
-
No local performance comparison or full production upgrade was run.
fengttt
left a comment
There was a problem hiding this comment.
You do not edit pb/api/api.go by hand. Where is the proto file change?
|
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: f0a84b5323c4e2454fefb4cb5541fae73879e16f
Assessment: request_changes
The shared, feature-gated read specification reuses existing schema metadata, and the earlier sparse-read, snapshot, and allocation-failure concerns have fixes. A supported in-place VARCHAR widening exposes a released-WAL recovery failure that the reported upgrade controls did not cover. The latest protobuf concern is disputed: the changed api.go is handwritten and copies a field already declared in api.proto.
Model: gpt-6.1-terra / max
Session: 01a21ea6-2de2-71f3-b7d7-f3fe6df56dd8 · slot 0 · generation 27
- P1
pkg/vm/engine/tae/tables/mnode.go:395: On v4.2.9, widen a VARCHAR column in place, checkpoint the updated catalog, then commit a small insert whose append WAL remains unflushed before restart or upgrade.
Impact: Recovery rejects the valid append and panics, preventing the TN from starting and the committed row from being recovered.
Evidence: The released planner permits in-place VARCHAR widening, while ReplaceDef is applied only on the CN; the TN continues to write append vectors using its original schema width. Checkpoint replay reconstructs the widened type from the catalog, but Type.Eq compares widths, so the new validation rejects the old-width WAL vector. The author's released-WAL controls cover ordinary and renamed columns, not this widening sequence. Preserve compatible widened storage types while retaining identity and collation checks, and add a release-produced checkpoint/WAL restart regression that verifies reads and a new write.
Validation:
-
Isolation preflight passed: preflight.log and checks/1795812837021235027-3.json.
-
git diff --check passed: diff-check.log and checks/1795813200394941110-3.json.
-
The released-source and replay-flow audits passed: source-audit.log, wal-width-source-audit.log, and checks/1795813413860818869-3.json and checks/1795813705757542226-3.json.
-
All 26 discussion entries were accounted for: discussion-assessment.json, discussion-audit-final.log, and checks/1795813673607490920-3.json.
-
The frozen CI snapshot reports successful x86 unit tests and proxy and pessimistic multi-CN BVT jobs; both upgrade compatibility jobs were skipped.
Limitations:
-
The widening failure is established by cross-version source tracing; no product binary or release artifact was executed locally for this case.
-
The author's reported v4.2.9 recovery checks used an earlier candidate and did not exercise in-place width changes across a checkpoint.
Resolve historical columns as typed NULL using the existing table feature flag and physical layout across reads and metadata consumers. Bind named WAL to the writer-visible schema and map renamed columns by physical sequence. Keep buffered names aligned through rename and checkpoint recovery. Stage positional writes that require allocation before replacing rows or primary-key entries. Resolve sparse workspace column positions for projections and filters. Preserve dropped-slot checks for logtail and Data Branch snapshots. Accept the released catalog text metadata when replaying 4.2 WAL.
Signed-off-by: XuPeng-SH <[email protected]>
|
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: ddb744d844d5ba582c42d5679e6d90a8fb439ddb
Assessment: request_changes
The shared read specification reuses existing schema metadata without changing the wire format. The earlier width-only WAL recovery issue is addressed, but recovery still rejects a valid combination of column rename and string widening across a checkpoint. The separate concern about editing generated protobuf code is disputed: api.go is handwritten and copies an existing field.
Model: gpt-6.1-terra / max
Session: 01a22b07-00b6-7e32-b0a1-3099d0b867c7 · slot 1 · generation 39
- P1
pkg/vm/engine/tae/txn/txnimpl/replaystore.go:292: A v4.2.9 writer starts with a column named value of type VARCHAR(8); the column is renamed and widened to VARCHAR(32), a checkpoint captures the new catalog schema, and the old writer commits an unflushed append afterward.
Impact: On restart or shutdown upgrade, replay rejects the committed append and panics, preventing the TN from starting and recovering the row.
Evidence: The released planner permits in-place rename and CHAR/VARCHAR widening. When the checkpoint has discarded the writer's schema, replay enters recoverCheckpointAppendNames, whose exact Type.Eq check rejects width 8 against width 32. The later installer explicitly accepts that safe widening in appendTypeCompatible. An isolated probe using the frozen helper bodies reproduced the rejection; same-width rename and the installer width predicate were controls. Apply compatible-width handling during checkpoint layout inference while retaining identity, charset and collation checks, and add a release-produced restart regression covering the combined case and subsequent writes.
Validation:
-
Isolation preflight passed; receipt checks/1796106872619610858-3.json.
-
The isolated Go 1.27.1 probe confirmed the combined rejection and its controls; receipt checks/1796107939838201041-3.json and wal-width-rename-go127.log. The copied function bodies were matched to the frozen checkout by checks/1796107618657786431-3.json.
-
git diff --check passed; receipt checks/1796107733682083962-3.json. The discussion assessment accounts for all 28 indexed entries.
-
The frozen CI snapshot reports successful shared build, x86 unit tests, and proxy and pessimistic multi-CN BVT jobs. Both release-compatibility jobs were skipped.
Limitations:
- The combined rename-and-widening case was not executed locally through a full released SQL or TAE restart. The diagnostic probe uses copied helper bodies and stubs; the supplied release-produced fixtures are author-reported and cover rename and widening separately.
|
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: 3a22f67b30ce63e94a6629f16b52ec97bb07e262
Assessment: request_changes
The shared NULL read specification and historical WAL handling reuse existing schema metadata. The earlier rename-and-widen replay concern is addressed, but change-range projection rejects valid older-width string values in an evolved table. The SQL writer that sets the evolved flag is planned for a later PR; this finding concerns the read foundation delivered here. The discussion about pkg/pb/api/api.go concerns a handwritten helper copying an existing protobuf field, so it does not require a proto change.
Model: gpt-6.1-terra / max
Session: 01a22aff-bb68-7e31-ae71-ee4ab48ad9d0 · slot 0 · generation 45
- P2
pkg/vm/engine/disttae/logtailreplay/change_handle.go:4828: An evolved table is read through a change range after a CHAR or VARCHAR column was widened in place, while an older object or committed logtail batch still carries the narrower type.
Impact: Data Branch and other change-range consumers receive an internal type error instead of the existing row. This affects the staged evolved-table reader once the feature flag is supplied; SQL ADD and DROP remain on COPY in this PR.
Evidence: This comparison requires exact types.Type.Eq equality, including width; appendProjectedInsert has the same check at line 4493. Existing in-place ALTER permits string widening, and TAE WAL replay accepts a narrower compatible string type. A focused test overlay against the candidate reproduced errors for VARCHAR(8) logtail and persisted-object values under a VARCHAR(32) read schema, while both equal-width controls passed. Applying the replay compatibility rule in a temporary production overlay made all four cases pass. Use a shared compatible-width rule for both projection paths, retain the other type and collation checks, and cover both storage representations.
Validation:
-
Isolation preflight and git diff --check passed; receipts 1796120363021827992-3 and 1796120843996517342-3.
-
Built native prerequisites in a diagnostic clone using make cgo and verified their provenance against the frozen head; receipts 1796121305336467953-3 and 1796121334783346980-3.
-
The candidate's TestSnapshotStateChangeRangeProjectsEvolvedColumns and TestReplayAppendAfterCheckpointStringWidening passed with the isolated executor; focused-product-tests.log, receipt 1796121844214000156-4.
-
The temporary test overlay reproduced both width failures on the candidate; receipt 1796121724025546053-4. A temporary compatibility-rule overlay passed the same four cases; receipt 1796121798673898760-4.
-
The supplied exact-head CI snapshot reports successful unit and two multi-CN BVT jobs.
Limitations:
-
The width reproduction exercises the internal change-range entry point with an evolved-schema fixture; this PR does not expose SQL Instant ADD.
-
The supplied release-upgrade CI jobs were skipped. The author's reported v4.2.9 TAE upgrade fixture was not independently rerun.
|
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: b0d7fe96ddee1a29c7cb3774d94e43006b5feacc
Assessment: approve
The NULL-only read foundation reuses schema sequence metadata and a shared read specification across CN and TN. WAL staging protects row and primary-key state on allocation failure. The latest change resolves the prior string-width finding for both logtail and persisted change-range reads. SQL ADD and DROP remain on the COPY path. The disputed protobuf edit is a handwritten helper copying an existing field.
Model: gpt-6.1-terra / max
Session: 01a22aff-bb68-7e31-ae71-ee4ab48ad9d0 · slot 0 · generation 45
Validation:
-
Isolation preflight and native provenance verification passed; receipts 1796129823496053519-3 and 1796129846734979483-3.
-
Focused change-range and checkpoint replay tests passed, including narrower and incompatible string widths; receipt 1796130079203368201-3 and focused-tests.log.
-
Sparse workspace and snapshot reads, cancellation, allocation-failure handling, catalog caching, and checkpoint-name recovery tests passed; receipt 1796130256912978601-3 and regression-tests.log.
-
Reader, pruning, aggregate, rename-replay, in-memory and persisted-node tests passed; receipts 1796130653637198680-3 and 1796130941465536109-3, with consumer-tests.log and tae-node-tests.log.
-
git diff --check passed; receipt 1796130734254582570-3. The supplied CI snapshot reports successful x86 unit tests and multi-CN proxy and pessimistic BVT jobs.
Limitations:
-
The author reports stopped v4.2.9 TAE/WAL upgrade runs using identified release artifacts; their raw logs were not supplied. Release-upgrade CI was skipped, and a full service upgrade was not independently run.
-
The author reports checking the changed SQL fixture in an embedded two-CN cluster. This review did not independently run mo-tester or verify that fixture's selection in the supplied BVT job logs.
-
Checks ran against the frozen PR head, not a synthesized merge with the newer target. Broader distributed rollout and performance qualification are assigned to the later PR in the series.
合并后验证交接(表结构演进入读取和恢复基础)本 PR 已合入
本留言记录第 1 阶段的验证范围与缺口,当前没有 QA 验收结果。 |
What type of PR is this?
Which issue(s) this PR fixes:
Tracks #33035 (native schema evolution for restricted Instant ADD COLUMN; design record · revision 2). Related request: #12555.
This PR provides the read-layer and WAL recovery foundation for metadata-only NULL-default column addition with zero
proto/changes.ADD COLUMNandDROP COLUMNcontinue to use COPY in PR 1.What this PR does / why we need it:
Old blocks and replayed batches can lack columns added after those rows were written. Use
ColumnReadSpec(activated exclusively byfeatures.IsSchemaEvolvedon both CN and TN, and lazily cached per finalized TAESchema) to give data reads, pruning, aggregates, ordered scans, Data Branch snapshot reads, replay, and statistics the same interpretation of absent columns.proto/orpkg/pb/plan/changes: initial implementation supports trailing nullable columns defaulting toNULL, resolving historical missing columns as typedNULLviafeatures.SchemaEvolvedand blockMaxSeqnum.SchemaExtrametadata across catalog updates, keep sparse column sequences and the sequence high-water mark, reserveSEQNUM_ROWIDin sparse layouts, use physicalprimarySeqnumfor persisted PK ZoneMap checks (PKPersistedBetween), and map sparse column sequences to logical workspace positions in uncommitted read-your-writes scans and filters.nullCnt = rows,ndv = 0, empty objects returning typed empty stats), and fail closed for missing columns within an object/batch layout across normal scans, committed logtail batches, and Data Branch snapshot scans.StartTS+ catalog MVCC visibility), map renamed columns and primary keys by stableSeqNum, keep buffered workspace column names aligned across in-transactionRENAME COLUMNandPrepareCommit(preserving identity across checkpoints and same-type column name swaps), normalize known 4.2 built-in system-table legacy text charset metadata on WAL replay, validate source layouts fail-closed, and stage all fallible positional allocations (including in-range NULL bitmap expansion vianulls.TryExpand) before deleting overwritten primary-key entries.ADD COLUMNandDROP COLUMNcontinue to use COPY.Follow-up fixes
Checkpoint WAL replay follow-up
Checkpoint replay now rejects an older append when its column order differs from the checkpoint schema and the original mapping cannot be proved. This prevents same-typed columns from silently exchanging values, including the primary key. The error identifies the table and checkpoint schema version and stops recovery before the ambiguous payload is installed.
TestRecoverCheckpointAppendNames. It checks that the ambiguous mapping is rejected and the payload is unchanged.9325ce38fdd9c3bd37d29c1d4509620065abb041: fulltae/txn/txnimplpackage, focused TAE restart and append tests, andgit diff --checkpassed.v4.2.9TAE upgrade: both fixtures had a global checkpoint between the rename and the old writer's commit. The two-column control read key1and payload42after restart. A fixture with a previously dropped third column recovered key42and payload1on the previous PR head. The fixed head rejected the ambiguous append during recovery.Validation
Follow-up commit
1aa7525e91ab5e748d32158c826f437c5a5d6c27passed targeted catalog, TAE replay and change-range regressions. Full local tests passed incatalog,objectio,disttae,disttae/logtailreplay,tae/catalog, andtae/txn/txnimplduring the follow-up, with targeted reruns after the final changes.Two stopped
v4.2.9TAE directories with a global checkpoint between the rename commit and the old writer's commit reopened successfully. Both a one-column rename and a same-type name swap recovered PK1and payload42through point lookup.Executed the checked-in
auto_increment_no_pk_metadata.sqlin an embedded two-CN cluster and compared all column names and rows with the checked-in expectations using the Go SQL driver. The local Java runner could not parse the expectation file.make err-checkandgit diff --checkpassed.Local test suite passed on commit
45e8276758837b8c94be429f2de95069b351a67f(rebased ontomainc90a2c4e579):mo-cgo-test -count=1across 17 affected packages (14 passed, 3 no test files);-race -count=1regressions acrosstae/tables,tae/db/test, anddisttaecoveringTestApplyAppendAtInRangeNullBitmapFailure,TestApplyAppendAtWALFillFailurePreservesRowsAndPrimaryKey,TestReplayAppendAcrossColumnRename,TestReplayAppendAcrossCheckpointColumnRename(rename / swap / swap_without_checkpoint),TestReplayAppendWithSameTxnColumnRename(5 same-txn orderings),TestReplayAppendLegacyCatalogWALTextType,TestWorkspaceReadsSparseColumnSequences,TestPrimaryKeysMayBeUpsertedSparsePrimaryKey, andTestScanSnapshotWithCurrentRangesColumnReadSpec(persisted & committed tail/hole);v4.2.9(6c05e42f9f660a207077b050b8ec285ccf3f8103) with unflushed committed append WAL (wal-1.rot, watermark=5, checkpointed LSN=0) for both an ordinary table and a renamed-column table: recovered original rows(1,101)and(11,201),(12,202)via scan and PK lookup, then committed and read back new rows(2,102)and(13,203);make err-check, repo-widego vet -mod=readonly ./..., repo-widemolint check -mod=readonly ./...,golangci-lint run --new-from-rev upstream/main(0 issues),git diff --check, and zero diff underproto/andpkg/pb/plan/.QA required: yes. CI on the updated head and multi-CN/performance qualification remain separate checks.
Validation after syncing main at
9bf005bfcd06The eight top-level tests reported by the previous x86 UT job passed in focused local runs on Darwin ARM64.
TestDataBranchFractionalTemporalPrimaryKeyalso passed with-raceon both9325ce38fdd9and524fe81d2a94. The CI artifact truncated the failing assertion, so its cause remains unconfirmed. Snapshot projection, checkpoint recovery and WAL replay regressions passed after adapting the replay fixture to the encoded batch API. Both changed packages passedmolintandgolangci-lint. The full localmolintinvocation stopped with 535 JSON results for 536 selected actions. Full Linux CI validation is pending.Change-range prefetch cancellation
Addresses the P2 review on
84fbaca77b5e. CN object and appendable-window prefetch now cancel sibling reads at the first failure, then drain those jobs and preserve the original error for snapshot fallback.The new regression reproduced the caller deadline on the previous commit for both CN read orders and the appendable-window path. On
67b345e930a8, the logtailreplay package suite passed. The new and existing cancellation regressions passed 20 repetitions each with-race. Scoped molint, golangci-lint, andgit diff --checkalso passed. The regression uses a file-service stub to control read ordering and cancellation.Rebase and string-width WAL recovery
Rebased the seven PR commits onto MatrixOne main
38c68d02ca62, including the maintainer's direct-vector fixture changes. The result uses the upstream positional TAE batch API and maps separately decoded WAL column names through the historical source schema.Addresses the P1 WAL recovery review. A checkpoint can reconstruct a wider CHAR or VARCHAR schema while committed append WAL still contains vectors with the previous width. Replay accepts the old width when the type, storage size, scale, charset and collation match. The sequence and column-layout validation still applies.
For the API review, the edit is in the handwritten
CloneExtrahelper inpkg/pb/api/api.go. It copiesFromPublication, which is already field 15 inproto/api.proto. The rebase has zero proto or generated protobuf changes.Local verification at
262c6fc26244:make err-checkandgit diff --checkpassed.Read-test fixture update
At
ddb744d844d5, adapted the ObjectIO and reader regression fixtures to the current batch, vector, and row-bitmap APIs. The tests cover typed NULLs for absent columns, selected-row and TopN reads, and tombstone reads with the data schema disabled. The bitmap selection checks distinct rows in physical order.The complete
pkg/objectioandpkg/vm/engine/readutilsuites passed locally on Darwin ARM64 with-race -count=1. Scopedgo vet,molint, andgit diff --checkpassed. The previous Linux run failed to compile these fixtures in the unit, static-analysis, and coverage jobs. Linux CI for this commit is pending.Checkpoint WAL recovery after rename and widening
Addresses the P1 review on
ddb744d844d5. A transaction can start with aVARCHAR(8)column and commit its append after a checkpoint records that column under a new name with width 32. The checkpoint fallback now uses the same CHAR/VARCHAR compatibility rule as WAL installation. The fallback still requires a provable dense column layout and rejects ambiguous column identities.TestReplayAppendAfterCheckpointStringWideningcovers both widening alone and rename plus widening. The combined case reproduced a restart panic at WAL column resolution on the previous PR head. Both cases pass on3a22f67b30ceand verify the recovered old row and a new write exceeding the old width.v4.2.9TAE API reopened on3a22f67b30ce. The probe verified the old row, the renamed column, and a longer new value. This validates the TAE recovery path. SQL-level upgrade validation remains outside this run.mainat6674873fdfdeand resolved conflicts against the direct-vector API. Fulltae/tablesandtae/txn/txnimplsuites, focused regressions across five affected packages, scopedmolintandgolangci-lint,make err-check, andgit diff --checkpassed locally on the updated head.Change-range reads after string widening
Addresses the change-range review. Evolved-table change ranges now reuse the WAL type-compatibility rule when projecting historical logtail rows and persisted blocks. A narrower stored CHAR or VARCHAR is read at the current schema width when the storage type, charset, and collation match. The existing checks for incompatible types and missing interior columns still apply.
git diff --checkpassed.Validated source commit:
b0d7fe96ddee1a29c7cb3774d94e43006b5feacc.