Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: The migration fails on CockroachDB (>= 22.1) #3353

Closed
1 task done
dshkuratov opened this issue Aug 5, 2024 · 1 comment · Fixed by #3573
Closed
1 task done

[Bug]: The migration fails on CockroachDB (>= 22.1) #3353

dshkuratov opened this issue Aug 5, 2024 · 1 comment · Fixed by #3573
Labels

Comments

@dshkuratov
Copy link

Bug Description

-- Add foreign key constraint on namespace_key column referencing key column of namespaces table
ALTER TABLE rules ADD FOREIGN KEY (namespace_key) REFERENCES namespaces(key) ON DELETE CASCADE;
ALTER TABLE rules ADD FOREIGN KEY (namespace_key, flag_key) REFERENCES flags(namespace_key, key) ON DELETE CASCADE;
ALTER TABLE rules ADD FOREIGN KEY (namespace_key, segment_key) REFERENCES segments(namespace_key, key) ON DELETE CASCADE; (details: ERROR: unimplemented: cannot perform a primary key change on flags with other schema changes on flags in the same transaction (SQLSTATE 0A000))

The migration fails on all CockroachDB versions later than latest-v21.2.

Version Info

    _________       __
   / ____/ (_)___  / /_
  / /_  / / / __ \/ __/
 / __/ / / / /_/ / /_
/_/   /_/_/ .___/\__/
         /_/

Version: v1.47.1
Commit: 96956c7c69852cc77e8b16a1b103bdf7a2c7f2b3
Build Date: 2024-08-02T13:35:36Z
Go Version: go1.22.5
OS/Arch: linux/amd64

Search

  • I searched for other open and closed issues before opening this

Steps to Reproduce

cd examples/database/cockroachdb/

change docker-compose.yml
image: cockroachdb/cockroach:latest-v21.2
to
image: cockroachdb/cockroach:latest-v23.2

run
docker compose up

Expected Behavior

the migration completes successfully

Additional Context

No response

@GeorgeMac
Copy link
Contributor

GeorgeMac commented Aug 5, 2024

Thanks for raising this @dshkuratov 🙏

This seems to be relevant: https://www.cockroachlabs.com/docs/stable/known-limitations#no-online-schema-changes-if-primary-key-change-in-progress (for those debugging this issue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants