Repository navigation
Description
Parent Issue
Parent issue: #29433
Detail of Subtask
Phase S8. Depends on: #29440, #29441
Activate the validated on-demand read path and remove its dependence on durable refresh maintenance, while keeping catalog/upgrade compatibility scaffolding until S9.
Deliverables:
- A staged, observable rollout with explicit eligibility, enable/disable behavior, operator checks, and rollback handling approved in S1/S5. Mixed-version support must be proven, not inferred from one disabled refresh flag.
- Make the new derivation boundary authoritative for the complete approved consumer inventory; no mixed old/new authority inside a request.
- After the compatible reader/writer boundary is satisfied, stop refresh-only reverse-closure writes, revalidation markers, worker/retry/lease work, scans, and lifecycle locks that no longer serve any remaining contract.
- Audit all owners before removing any admission/fence/barrier hook. Preserve persisted-expression authoring/read protocol floors, tenant/snapshot safety, and shared features despite View-prefixed names.
- Keep legacy catalog tables and required compatibility paths available during the supported rollback window. Explicitly handle catalog columns that may no longer be maintained before allowing rollback to old readers.
- Provide bounded-cardinality metrics for derivation cost/failures, compatibility rejection, and selected-cache behavior without retaining a persistent per-view refresh state machine.
Acceptance criteria:
- All required S5 correctness/compatibility and S6 performance gates pass on the delivery head. S7 is required only if the approved S6 decision made it a rollout prerequisite.
- Ordinary-view metadata reads have no dependency on recovery-worker availability; unused views require no background refresh work.
- Source DDL no longer takes refresh-only global locks or writes refresh-only state once the retirement boundary is active; preserve locks required for independent contracts.
- Rollback either demonstrably restores safe legacy behavior or is explicitly refused before serving incorrect metadata; toggling a flag alone is not a rollback plan.
- Update release/operator documentation and coordinate the superseded [Subtask]: Implement durable View metadata generations and recovery #29005/[Subtask]: Validate and harden on-demand View metadata execution and plan reuse #29006/[Subtask]: Activate and validate the View metadata lifecycle #29007 activation roadmap explicitly. Do not close the original bug until its public acceptance criteria are proven.
- No table drops or destructive historical-upgrade cleanup are bundled into this phase.
Describe implementation you've considered
Separate read-path activation, cessation of compatibility maintenance, and physical cleanup into distinct audited boundaries. The current refresh gate is fixed false, but inactive mutation paths still write revalidation markers and acquire lifecycle gates; inventory those paths rather than only disabling workers.
Additional information
Current anchors: pkg/sql/compile/view_metadata.go, view_metadata_recovery.go; frontend account/snapshot/publication paths; CN/HAKeeper admission code. Shared runtime state must not be removed based on filename or prefix matching.
Planning baseline: b9013dc6bb058ec74935a62ac3a35f57d13c2f98. This issue records future work, not completed implementation or fresh test evidence. All production work is subject to the approved versioned design from S1. Ordinary views only; materialized-view refresh and unrelated SQL compatibility work are out of scope.
Activity
fix: make View metadata migration idempotent (#29468)