Skip to content

Comments

changefeedccl: add regression test for schema_locked backfill skipping#164302

Draft
rharding6373 wants to merge 1 commit intocockroachdb:masterfrom
rharding6373:changefeed-schema-locked-backfill-test
Draft

changefeedccl: add regression test for schema_locked backfill skipping#164302
rharding6373 wants to merge 1 commit intocockroachdb:masterfrom
rharding6373:changefeed-schema-locked-backfill-test

Conversation

@rharding6373
Copy link
Collaborator

Add TestChangefeedSchemaLockedBackfill with 7 subtests that exercise schema changes on tables with schema_locked=true while a changefeed is running. The test validates that the SchemaFeed correctly detects all schema change events even when schema_locked optimization pauses descriptor polling.

Subtests:

  1. families: column families with schema_locked, drop + add columns
  2. no-families: same without column families
  3. sequential-changes: four sequential schema changes (drop, add, add, drop)
  4. computed-stored: ADD COLUMN ... AS ... STORED on schema_locked table
  5. alter-primary-key: ALTER PRIMARY KEY, verify new key encoding works
  6. truncate: TRUNCATE on schema_locked table, verify error is produced
  7. multi-table: two schema_locked tables with interleaved schema changes

These tests target bugs like #149861 where the declarative schema changer atomically toggles schema_locked alongside a column mutation, and the SchemaFeed's pauseOrResumePolling could advance the frontier past the mutation version, causing a backfill to be silently skipped.

Informs: #149861, #148963
Epic: none
Release note: None

Add TestChangefeedSchemaLockedBackfill with 7 subtests that exercise
schema changes on tables with schema_locked=true while a changefeed is
running. The test validates that the SchemaFeed correctly detects all
schema change events even when schema_locked optimization pauses
descriptor polling.

Subtests:
1. families: column families with schema_locked, drop + add columns
2. no-families: same without column families
3. sequential-changes: four sequential schema changes (drop, add, add, drop)
4. computed-stored: ADD COLUMN ... AS ... STORED on schema_locked table
5. alter-primary-key: ALTER PRIMARY KEY, verify new key encoding works
6. truncate: TRUNCATE on schema_locked table, verify error is produced
7. multi-table: two schema_locked tables with interleaved schema changes

These tests target bugs like cockroachdb#149861 where the declarative schema
changer atomically toggles schema_locked alongside a column mutation,
and the SchemaFeed's pauseOrResumePolling could advance the frontier
past the mutation version, causing a backfill to be silently skipped.

Informs: cockroachdb#149861, cockroachdb#148963
Epic: none
Release note: None

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@trunk-io
Copy link
Contributor

trunk-io bot commented Feb 24, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants