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

DML Transactions Not Honored in Liquibase #142015

Open
roachlong opened this issue Feb 26, 2025 · 1 comment
Open

DML Transactions Not Honored in Liquibase #142015

roachlong opened this issue Feb 26, 2025 · 1 comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@roachlong
Copy link

roachlong commented Feb 26, 2025

Describe the problem

Please describe the issue you observed, and any steps we can take to reproduce it:

Liquibase is a schema migration tool that tracks schema changes through an XML based change log, which contains a series of change sets. The contract with a change set is that all statements will execute autonomously and this works as expected with other DBMS systems. However, cockroachdb appears to commit each statement independently and a failure in the change set will leave the database in an unpredictable state.

To Reproduce

What did you do? Describe in your own words.

I created a simple example that inserts two records as individual statements of the same change set. The first insert succeeds but the second insert is setup to fail. After running the change log I would expect the first record to have been rolled back but it looks like it was committed as part of the migration.

If possible, provide steps to reproduce the behavior:

I've created a sample demo of the issue at https://github.com/roachlong/liquibase-demo with instruction on how to setup and execute the change log test documented in the README file.

Expected behavior
A clear and concise description of what you expected to happen.

I expect that the inserted record would have been rolled back and the event table to be empty at the end of the test.

Additional data / screenshots
If the problem is SQL-related, include a copy of the SQL query and the schema
of the supporting tables.

All information is included in the https://github.com/roachlong/liquibase-demo repo.

If a node in your cluster encountered a fatal error, supply the contents of the
log directories (at minimum of the affected node(s), but preferably all nodes).

Note that log files can contain confidential information. Please continue
creating this issue, but contact support@cockroachlabs.com to submit the log
files in private.

If applicable, add screenshots to help explain your problem.

Environment:

  • CockroachDB version [e.g. 2.0.x]: v.24.3.3
  • Server OS: [e.g. Linux/Distrib]: running as single-node-instance on MacOS Silicon 15.3.1 (24D70)
  • Client app [e.g. cockroach sql, JDBC, ...]: JDBC org.postgresql.Driver 42.7.4

Additional context
What was the impact?

Add any other context about the problem here.

Jira issue: CRDB-48120

@roachlong roachlong added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Feb 26, 2025
Copy link

blathers-crl bot commented Feb 26, 2025

Hi @roachlong, please add branch-* labels to identify which branch(es) this C-bug affects.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@yuzefovich yuzefovich added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

No branches or pull requests

2 participants