Skip to content

Lock writes during gitlab:setup task

Thong Kuah requested to merge lock_writes_setups into master

What does this MR do and why?

Lock writes during gitlab:setup task

This helps protect against split-brain situations in case of bugs / mis-configurations for decomposed setups.

Lock writes should do nothing for single-database setups

Related issue: #393145 (closed)

Screenshots or screen recordings

Lock writes appear in newly setup databases (two databases configured):

main database ci database
Screenshot_2023-03-31_at_3.59.08_PM Screenshot_2023-03-31_at_3.59.28_PM

No lock writes in new setup database (single database configured):

Screenshot_2023-03-31_at_4.06.21_PM

How to set up and validate locally

  1. Change your config/database.yml database: to temporary, eg. gitlabhq_development_temp. So you don't lose data in next step
  2. Run bundle exec rake gitlab:setup

After you are done testing, you can restore your config/database.yml

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thong Kuah

Merge request reports

Loading