Skip to content

logical,txn: allowlist and version-gate DROP COLUMN for LDR #175741

Description

@DarrylWong

Summary

Allow the declarative schema changer to run the supported DROP COLUMN migration on transactional LDR tables, after all required decoder and index-rewrite correctness work is cluster-wide.

Initial supported scope

Support dropping a nullable, non-primary-key column that is not involved in:

  • Secondary indexes
  • Unique, foreign-key, or check constraints
  • Computed, default, or on-update expressions
  • Multiple column families
  • ALTER PRIMARY KEY
  • Compound ALTER TABLE statements or DROP COLUMN ... CASCADE

Scope

  • Extend the LDR DDL allowlist for the narrow DROP COLUMN operation.
  • Require every LDR job referencing the table to permit online schema changes.
  • Keep ON_SCHEMA_CONFLICT and TRUNCATE EXTRA COLUMNS as separate safety controls: the former enables schema skew; the latter authorizes dropping non-NULL source-only data.
  • Reject unsupported dependency/index cases before changing the descriptor, with actionable errors.
  • Add a cluster-version gate that becomes active only after live-row metadata, tombstones, temporary-index merge metadata, and decoder truncation support are present on every node.
  • Verify source and destination schema replanning across the drop boundary.
  • Add focused SQL/integration tests for allowed and rejected forms.

Done when

The supported DROP operation completes while LDR continues through temporary schema skew, unsupported forms are rejected before mutation, and mixed-version clusters cannot enter a state older nodes handle incorrectly.

Dependencies

Depends on all three index-backfill correctness tickets, per-table TRUNCATE EXTRA COLUMNS, and the policy-gated column-change work in cockroachlabs/cockroach#5064.

Design: https://docs.google.com/document/d/1FRb0lVEKAZGOGW0csPw5HBtf5_FqSPBoP-RcW_pnVdM/edit

Jira issue: CRDB-68658

Epic CRDB-68660

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cdcChange Data CaptureA-logical-data-replicationC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-cdc

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions