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
-
Make sure you are running gdk with two databases. Default setup
-
Make sure the table is not locked for writes on
main
orci
. Please make sure no important data in this themain
database and in this tablevalue_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'
-
Run the migration locally:
rake db:migrate
-
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
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #416963 (closed)
Edited by Omar Qunsul