Skip to content

Document "schema_change_policy = 'nobackfill' is not fulfilled within explicit transaction #21539

@smcvey

Description

@smcvey

When a changefeed is created with the 'schema_change_policy = 'nobackfill' option, and is followed by a schema change that performs a backfill - we do not normally expect any output to the changefeed.

However, if the schema change is performed as part of an explicit transaction, then it does emit the entire table to the changefeed, undermining any expectation of the 'nobackfill' option.

Example:

This command would not emit the entire table despite adding a default value to every row:

ALTER TABLE t ADD COLUMN x INT DEFAULT 0 NOT NULL;

However, this would emit the entire table, despite 'nobackfill':

BEGIN;
ALTER TABLE t ADD COLUMN x INT DEFAULT 0 NOT NULL;
COMMIT;

SQL Foundations are working on a fix but this will take a long time, and we've both agreed this behaviour should be documented.

The suggestion is that a sentence is added to the 'schema_change_policy' box in https://www.cockroachlabs.com/docs/stable/create-changefeed#query-parameters.

This only applies to versions before 25.1.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions