Repository navigation
refactor(view): add inactive metadata lifecycle - #27370
Conversation
# Conflicts: # pkg/bootstrap/versions/v4_0_6/tenant_upgrade_list.go # pkg/bootstrap/versions/v4_0_6/upgrade_test.go # pkg/sql/plan/build_ddl.go # pkg/sql/plan/query_builder.go # pkg/sql/plan/view_dependency_test.go # pkg/sql/plan/view_regeneration.go
aptend
left a comment
There was a problem hiding this comment.
Deep re-review of exact head 1640da615924a32fb140e03ab164d5d3c17e6e77. I read the complete prior review/thread state, audited the full diff, and checked the increment after previously reviewed head 755a799882405d0595ee8310a339e2a912c4fb58. The recovery compiler now validates timestamp hints against live mo_snapshots, and the drop path correctly checks whether another snapshot retains the same timestamp. However, the new invalidation SQL cannot execute against the catalog schema, so the prior timestamp lifecycle issue is not closed; see the inline P1.
A temporary schema-contract regression reproduced the mismatch deterministically: when generated SQL contains d.snapshot_name, catalog.MoViewDependenciesDDL has no snapshot_name column. The test fails on this exact head. I removed the temporary test afterward.
Unmodified validation passed for full pkg/sql/compile, pkg/frontend, pkg/sql/plan, pkg/sql/util, and pkg/vm/process; focused view/snapshot race tests passed under -race -count=3; focused go vet and git diff --check passed. Current CI still contains failed PESSIMISTIC BVT and follow-on Coverage jobs even though the aggregate Summary is successful.
aptend
left a comment
There was a problem hiding this comment.
Deep re-reviewed exact head e0706a4b9e5d2d69f2987b142912551754e9513e. I read the complete review/comment/thread history, inspected the increment after my previous reviewed head 1640da615924a32fb140e03ab164d5d3c17e6e77, and rechecked the full view-metadata lifecycle diff. The previous DROP SNAPSHOT blocker is closed: invalidation now derives the named-vs-timestamp distinction from the persisted snapshot_data schema, timestamp-only protobuf JSON omits ExtraInfo, named snapshots persist ExtraInfo.Name, and the generated recursive invalidation statement parses successfully without referring to a nonexistent catalog column. The last-snapshot-at-a-timestamp guard and recovery-time live-catalog validation remain intact.
Validation on this exact worktree: full pkg/sql/compile, pkg/frontend, pkg/sql/plan, pkg/sql/util, and pkg/vm/process tests; focused snapshot/recovery race tests with -count=3; focused persisted-JSON/generator counterexamples; go vet; and git diff --check all pass. No remaining blocking correctness or lifecycle issue found.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep re-reviewed exact head 0a3caff. I reused the already-reviewed closure through e0706a4, rechecked both prior snapshot blockers, audited the full current lifecycle/ownership/wait-for graph, and reviewed the increment: the only PR-owned production changes after that approval are test seams for the inactive gate/budget plus expanded lifecycle coverage; the two main merges do not rewrite lifecycle production code. The hard-false public/internal gates keep recovery inactive, while current mutations durably mark revalidation in their caller transaction; CTAS/subscription binding changes restore scoped compiler state. No blocking correctness, resource-lifecycle, concurrency, or unbounded-memory issue found. Local validation passed: full tests for sql/compile, frontend, sql/plan, sql/util, and vm/process; go vet; focused lifecycle/CTAS/subscription tests under -race -count=3; and git diff --check.
Merge Queue Status
This pull request spent 34 minutes 42 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonThe merge conditions cannot be satisfied due to failing checks Failing checks:
HintYou may have to fix your CI before adding the pull request to the queue again. Requeued — the merge queue status continues in this comment ↓. |
Merge Queue Status
This pull request spent 34 seconds in the queue, including 2 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #26227
What this PR does / why we need it:
This PR adds the inactive View metadata lifecycle layer on top of #27267.
It adds:
Inactive boundary:
ViewMetadataRefreshEnabledis structurally fixed tofalsein this layer;REVALIDATE_REQUIREDmarker in the caller transaction while activation is unavailable;This revision removes the incomplete local-cache-based capability barrier previously present in this PR. It does not claim rolling-upgrade activation safety.
Validation:
pkg/hakeeper,pkg/logservice,pkg/clusterservice,pkg/sql/compile, andpkg/frontendon the final merged base;pkg/sql/compileandpkg/frontendbefore the final base merge;go vetfor the owning packages before the final base merge.