-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Adding column and inverted index in transaction fails #42643
Copy link
Copy link
Open
Labels
A-schema-changesA-schema-transactionalC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.S-3-ux-surpriseIssue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Metadata
Metadata
Assignees
Labels
A-schema-changesA-schema-transactionalC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.S-3-ux-surpriseIssue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Describe the problem
When adding a column and creating an inverted index for that column within the same transaction this fails.
I run the following migration script - using https://github.com/pressly/goose -
Which fails with the following error:
As a workaround i can disable the migration script to use a transaction with
-- +goose NO TRANSACTION, then it runs fine.I wonder if this is intended behaviour or something that should actually be possible.
To Reproduce
First create a network so containers can communicate with each other by name:
docker network create testStart cockroachdb in single node mode:
docker run --name cockroachdb --network test -d -p 8080:8080 -p 26257:26257 cockroachdb/cockroach:v19.2.0 start-single-node --insecure --advertise-addr cockroachdb --logtostderrRun my database migration container against the cockroachdb container:
Although the error doesn't result in a failing container you'll see the following error in the logs:
Expected behavior
The script to execute and add both the column and the inverted index for that column; it did in the past against a prior version of cockroachdb.
Environment:
v19.2.0cockroachdb/cockroach:v19.2.0golang pq libraryJira issue: CRDB-5337
Epic CRDB-104