Skip to content

Draft: Locking value_stream_dashboard_aggregations for writes on CI

What does this MR do and why?

Addressing #416963 (closed)

Changelog: fixed

How to set up and validate locally

  1. Make sure you are running gdk with two databases. Default setup

  2. Make sure the table is not locked for writes on main or ci. Please make sure no important data in this the main database and in this table value_stream_dashboard_aggregations, otherwise please backup the main database before running these two commands. None of these commands will give an error:

gdk psql -d gitlabhq_development -c 'delete from value_stream_dashboard_aggregations'
gdk psql -d gitlabhq_development_ci -c 'delete from value_stream_dashboard_aggregations'
  1. Run the migration locally: rake db:migrate

  2. Run the commands again:

gdk psql -d gitlabhq_development -c 'delete from value_stream_dashboard_aggregations'
gdk psql -d gitlabhq_development_ci -c 'delete from value_stream_dashboard_aggregations'

The 2nd command only should give an error as expected

ERROR:  Table: "value_stream_dashboard_aggregations" is write protected within this Gitlab database.
HINT:  Make sure you are using the right database connection
CONTEXT:  PL/pgSQL function gitlab_schema_prevent_write() line 4 at RAISE
  1. If you rollback, you should be able to run both commands without an error

MR acceptance checklist

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

Related to #416963 (closed)

Edited by Omar Qunsul

Merge request reports