Skip to content

feat: extend metadata-only ADD to restricted BOOLEAN DEFAULT false - #30958

Closed
VioletQwQ-0 wants to merge 55 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/data-cleaning-default-false-draft
Closed

VioletQwQ-0 wants to merge 55 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/data-cleaning-default-false-draft

Conversation

@VioletQwQ-0

@VioletQwQ-0 VioletQwQ-0 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Related to #30518; this restricted optimization does not close the investigation tracker.

Depends on #30816. Its exact a44bc4b37cc221938dd29da63cf965185c75ab5c head (including partition safety repair c547c949bc) and pinned main 2465dae7a4ada1b277113cca5afff6fe10149b96 are integrated without rewriting the measured history. The main-based diff still contains the unmerged prerequisite. Its outstanding public design review and merge/deployment gates remain separate; keep do-not-merge/wip until those are resolved. This PR remains Draft while the new integrated-head CI and the open prerequisite design boundary are reconciled; Ready will mean ready for formal review, not permission to merge or enable in production.

What this PR does / why we need it:

data_cleaning adds a nullable BOOLEAN DEFAULT false before UPDATE/DELETE. Persist an immutable old-row missing-column value separately from the current INSERT default so an eligible ADD can avoid COPY without changing historical reads.

Supported scope and ownership

  • Default-disabled: requires mo_m0 plus guarded, isolated, same-executable LOG/TN/CN admission. Only independent pessimistic RC autocommit, one trailing nullable BOOLEAN literal false, and the existing M0 table/layout restrictions qualify. Ordinary builds retain COPY behavior.
  • Decide fallback before catalog mutation. Legal ineligible default-algorithm operations and later false-history transitions use existing transactional COPY; unsupported explicit INPLACE rejects. The inherited NULL-only experimental domain retains its existing pre-mutation rejection of unsupported later DDL; this PR does not add a general NULL-domain COPY exit.
  • SchemaExtra / mo_tables.extra_info owns durable history. Projections, captured writes, clone, logtail and recovery carry the identity. Existing physical values and NULLs win; only a proved complete old physical prefix may receive typed suffix values.
  • Schema/default/fill publish atomically. Standard COPY exit materializes an ordinary target and clears its append state in the same user transaction, preserving historical readers and clones. Standalone CREATE INDEX uses that same exit path. Scan proof errors propagate before postprocessing.
  • Public metadata_scan and column min/max use the same proved immutable fill rule. Aggregate zone maps own their bytes. Mixed old false suffixes and physical true/NULL are checked before COPY exit, with relation/version identity assertions.

No additional default types/expressions, transaction expansion, scheduling/merge policy, cache or optimization mechanism is included.

Design, compatibility and review

Versioned design R2 (SHA256 2a2f7cd2604ebc4df226a08893dbc329bc6e9d3d80d0fa78f1a8a8eb0612c443) has a distinct independent design decision, followed by an independent no-context implementation review/repair loop. Two public metadata findings and the mixed-object coverage follow-up were closed. Model review does not dismiss #30816's public review or replace maintainer approval.

Durable schema/protobuf metadata changes are intentional. Unknown-field tolerance does not make old binaries safe. The cooperative launcher, inode xattrs and inherited lock require an exclusive owner; they cannot stop arbitrary old executables. Mixed versions, rolling upgrade, downgrade, arbitrary recovery tools and production enablement remain unqualified. Keep the feature disabled if isolation cannot be enforced. See tools/data_cleaning_birth/DESIGN.md, DESIGN_REVIEW.md, README.md and STATUS.md.

Prior integration validation (historical 1497acd)

Prior integrated head: 1497acd95502a19f12fa622d9f7bc6113c1e4b3a (metadata repair 109332183a97a3f89bcf9328bac9efd376364a6c; 9c18153294 removes a redundant post-nil-guard check and consumes three negative SQL probes without allocating Rows; 5ef8889cbd only preallocates a regression input slice, with its length, values and assertions unchanged).

  • Resolved the actual main conflicts while preserving both SQL-mode COMMENT handling and cluster-key replay plus captured write-schema semantics.
  • Fixed old CI first errors: standard moerr admission errors, no unnecessary target CopyTableDef call on ordinary COPY, and nil-safe catalog extra projection.
  • Local ordinary admission/compile/catalog owning packages: 1,619 root tests pass. Focused tagged package checks cover COMMENT, replay/cluster keys, memory proof failures and COPY/CREATE INDEX exit. At 9c18153294, tagged SQL qualification passed 15 root tests, including the new public metadata subtest, clone/merge, cancellation/rollback, same-binary restart/checkpoint, ordinal/View controls and ordinary COPY.
  • The new metadata failure was reproduced before repair. Conservative physical zonemap upper bounds are not confused with exact row extrema; stored NULLs remain NULL. Temporary diagnostic logging is removed.
  • At that earlier integrated snapshot, selected tagged static analysis passed for eight affected packages; the three lint-affected SQL roots and two targeted package roots also pass. Darwin -race -count=3 passed five roots across four packages (15 root executions), including the real SQL metadata/recovery path. The later exact-head CI/BVT and distinct Linux ordinary/tagged receipts are recorded below. No current-head pass is inferred from old binaries. Ordinary CI alone does not qualify mo_m0. The ordinary plan-package static check and transition regression also pass after the final capacity-only repair.
  • CI run 40268573880 at 9c18153294 passed ordinary UT, Shared Build and PROXY BVT. Its ordinary SCA found the plan-test capacity issue now repaired; coverage failed when cross-package admission waits consumed the embed package deadline. The existing bounded-pool correction is tracked independently in CI #468; its canary success does not turn this PR's failed producer green. Subsequent run 40273113993 at 5ef8889cbd passed ordinary UT, SCA, UT Coverage and both BVT groups; its aggregate changed-code coverage failed at 480/835 (57.49%). CI fix format print #468 is merged; that earlier producer timeout is not the remaining coverage failure. The prior 9c18153294 PROXY group excluded DDL. At 5ef8889cbd, actual PROXY selection executed customer 73/73 and algorithm/lock 30 passed / 5 ignored / 0 failed; this is ordinary BVT, not guarded mo_m0 qualification.
  • Canonical BVT coverage is extended in test/distributed/cases/ddl/m0_customer_add_clone.sql / .result, alongside the existing fallback/algorithm case. Local official mo-tester execution is not claimed; actual CI case selection must be read back.

Dependency and coverage closure (1497acd)

  • Merge 25d1e5b76d integrates prerequisite a329de964e: legacy proof requires actual catalog database/table IDs and canonical column seqnum/type, rather than a table name alone. The owning tables package passes 23 roots plus the new typed-fill consumer test.
  • Public Initialize still rejects an ordinary binary before manifest I/O. Its unchanged validation/publication body has one private owner. Default-build tests now validate identity, lock/root/config binding, corrupt markers, failed reinitialization and exact rejection reasons, instead of accepting an unrelated build-gate error for every negative input. Tagged exec and startup tests exercise the real public path.
  • Existing mode-independent COPY-exit and deep-copy tests run in both builds. Injected hook/typed-fill tests prove shared consumer/dispatch contracts only; they do not substitute for producer policy or deployment qualification. CN projection tests require a valid complete layout and independently owned birth metadata. Unadmitted startup rejects marked data, fileservice and disk-cache directories.
  • Ordinary targeted checks pass 17 roots. After removing the test-migration unused import, tagged checks pass 20 roots across five packages; the subprocess-only helper skip remains explicit. Focused race passes 24 root executions (eight roots, count=3, five packages). Ordinary and tagged static analysis pass for all five affected packages; err-check and diff-check pass. Independent delta review and the final cleanup/import microdelta review PASS.
  • Actual final-head CI run 40286544209 reports changed-code coverage 631/836 = 75.48%, PASS. The existing >75% gate and exclusions are unchanged; no CI-repository edits were made. The earlier 630/836 local hybrid projection is retained as an estimate, not the official result. Shared Build, SCA, UT Coverage, aggregate Coverage and both BVT groups passed. Actual PROXY selection ran customer 73/73 and algorithm/lock 30 passed / 5 ignored / 0 failed; these are ordinary BVT results.
  • Ordinary UT attempt 1 failed before checkout or tests while downloading the CI action archive. The one targeted infrastructure retry completed successfully as attempt 2, job 121475574389; CI Required also passed.
  • That earlier phase executed dependency/coverage repair only. The separately authorized Linux window is recorded below. Prepared inputs bound to 5ef8889cbd remain superseded; no new SF100 was started.

Linux qualification (1497acd, 2026-10-27)

  • Small-data real SQL passes six unique roots: four admitted mo_m0 roots (TestM0BirthFalseSQL, fallback, transaction fallback and public ordinals), ordinary TestPublicOrdinalsStoredSystemViewSQL, and unadmitted tagged TestM0DefaultFalseCopySQL. This covers the stored false/content oracle, ADD object non-rewrite, clone/merge, same-binary restart/checkpoint, COPY exit, fallback and ordinal boundaries. The ordinary root covers explicit COPY/ordinal behavior; ordinary DEFAULT false SQL is additionally covered by exact-head ordinary CI BVT. Tagged unadmitted control is not called an ordinary binary.
  • Go 1.27.1 Linux/amd64 and native artifacts freshly built from frozen source; final tracked source remained clean. Runtime resource/identity gates passed, owned swap stayed zero, and host-attributed swap was WARN-only under the unchanged contract. All 86 archived evidence hashes verified after readback; work/client cgroups closed and the exact lock released. A subsequent foreign owner was left untouched.
  • R4's redundant target environment failed before native compilation and is retained as BLOCKED_BUILD_ENVIRONMENT. R5's ordinary filter selected zero tests and is NOT_RUN; only its four real admitted passes are reused. R6 supplies the actual ordinary/COPY controls with exact nonempty selection and terminal assertions. No empty package pass is treated as qualification.
  • This is restricted same-binary correctness, not new performance, mixed-version, downgrade, crash/power-loss or production qualification. At the end of that frozen window, 1497 remained Draft and conflicted with advanced main. The subsequent integration below resolves those conflicts; this old Linux result is not relabelled as the new head.

Main/dependency conflict closure (e79a108, 2026-10-27)

  • Final pushed head e79a108cc3be230a3a1bcfee3c18b2a256501eca. Normal merge 8c2b82a775 integrates pinned main 2465dae7a4; merge c378c67ec2 integrates prerequisite a44bc4b37c and its partition-admission repair. Commit e79a108cc3 adds regression coverage and restores the import required by the incoming test. Existing history is preserved.
  • Merge/flush retain upstream physical-row preservation together with M0 typed proof. Catalog imports, memory-row consumers, both BVT scenario sets and authoritative partition rejection are preserved. The guarded false path also reaches the partition guard before publication. No new optimization, default type, deployment mode, ObjectIO mechanism or persistent state was introduced in this repair.
  • Matching CPU native dependencies were rebuilt for main's usearch 2.26.5 update. At the final content: ordinary targeted contracts pass 19 roots; tagged contracts pass 33; real tagged SQL passes 11 roots (including guarded DEFAULT false partition COPY/INSERT/routing, rollback/cancel/interleave, clone/merge/recovery and COPY exit); physical-row/merge controls pass two roots; typed-fill race passes three executions. Both-mode configured static checks for six affected packages report zero issues. PR-relative whitespace and repository err-check pass.
  • Independent integration review and the final five-file regression delta review PASS. The review found the new fixture's nil-metadata misuse; the first failing run is retained, and the repaired fixture uses the existing replay path with two explicit physical row ranges. Incoming partition UT also needed its catalog import restored after the earlier fixture move. No product oracle was weakened. The canonical SQL/result retains incoming partition and candidate birth/index/metadata cases, plus the DEFAULT false partition control.
  • The new head owns its pending CI/BVT; 1497's 75.48% and green CI remain historical. No new Ubuntu or SF100 was started during this conflict-repair phase. The frozen Linux1497 and D3/C3 performance receipts remain bound to their own versions.
  • feat: add experimental metadata-only ADD for nullable columns #30816's maintainer-requested ObjectIO/persisted-data redesign and upgrade decision with aptend/LeftHandCold remain open. This integration resolves conflicts and carries the partition safety fix; independent model review does not close that architecture CR. Keep default-off and do-not-merge/wip; no Ready, merge or production approval is claimed here.

Sealed measured evidence (D3/C3, not this integrated binary)

COPY control D3: 64aa85d35f926136bdb249ece3839307fedef1ca.
Measured candidate C3: 0343d680a7bce6763e6aea4c513601212bf95f3a.

The formal local screen completed twelve valid arms: three alternating pairs per cleaned 2.94M-row UPDATE/DELETE fixture. Original-chain median speedups were 3.626x / 3.631x; content, mechanism, read, continuation, cumulative CPU/write and cleanup gates passed. The invalid first DELETE pair is retained and excluded as a whole; its one permitted environment rerun is recorded. Those fixtures have zero DML matches; separate 60K-row actual UPDATE/DELETE checks showed 1.71x / 2.08x chain speedups and about 27–29% lower cumulative CPU.

One full SF100 data_cleaning pair, 10 workers x 20 steps, completed:

Phase D3 driver elapsed C3 driver elapsed Ratio Business MO CPU D3 -> C3
process-first-run 112.61 s 24.51 s 4.59x 876.50 -> 169.38 core-s
warm 113.44 s 23.82 s 4.76x 882.85 -> 168.47 core-s

Each round completed all 200 steps, zero unexpected SQL errors, evaluation checks and bounded sanity. Actual operation graphs, inherited widths and cross-read counts differ, limiting causal attribution. Setup, driver, fixed 60-second observation, DROP and shutdown are reported separately. LocalFS successful-call bytes are not object payload, WAL or device I/O; fixed windows are not natural drain. Full every-branch contents, long-term debt, statistical significance, stable speedup and recovery of the paper's 58.6 seconds are not claimed.

These are frozen historical performance receipts, not measurements of the integrated head. No new SF100 run was started merely to obtain Ready status; a future relevant execution-path change must receive proportional revalidation rather than relabelling C3 evidence.

Remaining acceptance gates

  • Main conflicts are resolved at e79a108cc3; local affected validation passes. Required CI and actual BVT selection must now complete on this new head before Ready is reconsidered. The older Linux qualification remains explicitly bound to 1497, with integrated shared-path changes covered by the current local controls and pending new CI.
  • Resolve the prerequisite's public review/merge state and obtain maintainer acceptance of the restricted persistent-format/deployment contract before merge or wider enablement.
  • QA required: yes — persistent history, clone, public metadata, rollback and recovery are involved. Automated terminal checks cover the restricted path; mixed-version/old-tool access, broader deployed QA and production compatibility remain outside this qualification. Ready is not QA acceptance and does not request issue closure.

VioletQwQ-0 and others added 30 commits October 21, 2026 12:55

This branch had an error being deployed

1 failed deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants