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

CockroachDB translator generates SQL which can/will break databases #104

Closed
aeneasr opened this issue Feb 11, 2021 · 7 comments
Closed

CockroachDB translator generates SQL which can/will break databases #104

aeneasr opened this issue Feb 11, 2021 · 7 comments

Comments

@aeneasr
Copy link
Member

aeneasr commented Feb 11, 2021

Currently, the CockroachDB translator generates statements that are executed in transactional isolation by appending COMMIT TRANSACTION;BEGIN TRANSACTION; introduced by this commit: da6a949

The idea behind this is simple. CRDB does not support mixing SCHEMA DDL and non-DDL in a single transaction. The idea of the approach is to run each statement in its own transaction.

The problem is though, if any of the transaction fails, the rollback mechanism will not work. Leaving the database in a state where parts of the transactions have completed while others have not. The way the pop migrator works (keeping track of which files have been applied) means that we can end up in a state where migrations can no longer be applied and manual intervention is required.

We will probably work around this ourselves using the approach I outlined in #92 and splitting every SQL instruction into its own file, to ensure that we never end up with a broken state.

@sio4 sio4 added the s: triage label Sep 16, 2022
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.

@github-actions github-actions bot added the stale label Oct 17, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 30+7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2022
@sio4 sio4 reopened this Oct 25, 2022
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.

@github-actions github-actions bot added the stale label Nov 25, 2022
@sio4 sio4 removed the stale label Dec 2, 2022
@github-actions
Copy link

github-actions bot commented Jan 2, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.

@github-actions github-actions bot added the stale label Jan 2, 2023
@sio4 sio4 removed the stale label Jan 6, 2023
@github-actions
Copy link

github-actions bot commented Feb 6, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.

@github-actions github-actions bot added the stale label Feb 6, 2023
@sio4 sio4 removed the stale label Feb 6, 2023
@github-actions
Copy link

github-actions bot commented Mar 9, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.

@github-actions github-actions bot added the stale label Mar 9, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 30+7 days with no activity.

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

No branches or pull requests

2 participants