Enable lock retries by default for transactional migrations
What does this MR do and why?
Runs migration WithLockRetries by default, unless the ddl_transaction is disabled.
Notes:
-
At the worst case we will force run the migration (without timing out), but it was an (optimistically) intentional decision made during development.
-
Also there were only 2 such occasions (log) in the past month, so I am positive that this should not create a problem (as we enable_lock_retries! for most of the migrations already).
-
-
Follow up issues has been created to
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
-
Create a new migration
bundle exec rails g migration CreateTestTable
-
Observe the logs,
tail -f log/migrations.log
-
Run the created migration and we should be able see the below log entry (with message:
Lock timeout is set
){"severity":"INFO","time":"2024-02-19T18:31:58.634Z","correlation_id":null,"method":"with_lock_retries","class":"CreateTestTable","message":"Lock timeout is set","current_iteration":1,"lock_timeout_in_ms":100}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #419234 (closed)