这是indexloc提供的服务,不要输入任何密码
Skip to content

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

@aeneasr

Description

@aeneasr

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions