mongock / mongock

Lightweight Java based migration tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

System migrations don't respect transaction settings

mcveat opened this issue · comments

Description

Running migrations with mongock (with transactions disabled on driver and runner level) against a database that migrations haven't been run before fails with error

ERROR starting session. If Mongock is connected to a MongoDB cluster which doesn't support transactions, you must to disable transactions

PRIORITY

CRITICAL

Version and environment

Mongock

  • Mongock version : 5.2.2
  • Modules involved(springboot, standalone, MongoDB, DynamoDB, etc.) : standalone
  • How Mongock is used(builder or annotation approach, etc.) : builder

Environment

  • mongo-java-driver: 3.8.2
  • mongo 5.0.7

Steps to Reproduce

  1. Take the example standalone runner project and disable transactions (driver.disableTransaction() and MongockStandalone.builder().setTransactionEnabled(false).setTransactionStrategy(TransactionStrategy.EXECUTION))
  2. Run migrations against the database using mongo client or mongo server instance that does not allow transactions

Behaviour

Expected behavior:

Migrations run successfuly

Actual behavior:

Execution fails with error

ERROR starting session. If Mongock is connected to a MongoDB cluster which doesn't support transactions, you must to disable transactions

How often the bug happens:

Every time

Additional context

I believe it is happening because:

Hello @mcveat ,

We'll take a look at this soon. Probably Monday evening.

Thanks

Hello @mcveat , we've just released Mongock's version 5.2.4, which fixes this issue. Please could you try it and let us know? Thanks.

Thanks @osantana85 , I hope to find time to try it sometime this or next week, will let you know