-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: transactions containing certain DDL statements are not atomic #42061
Description
Related to #26508, #24785.
Filing this in reaction to a recent thread with @mberhault
Today, CockroachDB will accept to process DDL statements inside explicit txns (BEGIN...COMMIT), but process them after the non-DDL statements have been committed successfully.
If the DDL subsequently fails, the transaction is then both partially committed and partially rolled back. i.e. an atomicity violation.
If/when this happens, is currently reported to the client upon COMMIT via the special error code XXA00 (TransactionCommittedWithSchemaChangeFailure)
There is a discussion to be had about whether the situation should be allowed to occur at all, but until it does this issue will exist so it can be linked from the source code and docs for explanatory purposes.
Jira issue: CRDB-5394
Epic CRDB-104