cockroachdb / cockroachdb/docs

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

Open
#21,539 1 comment 0 reactions 1 assignee Claimed by @rmloveland View on GitHub
Dominant language
HTML
Stars
212
Forks
476
Avg merge
40m
Merged PRs (30d)
3

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.