Prevents `alter_cell_sequences_range` rake to alters cell sequences for legacy cell
What does this MR do and why?
It prevents invoking alter_cell_sequences_range rake for Legacy Cell
- Adds a new attribute to cells config to identify if the cell is a legacy.
- It doesn't alter cell sequences when invoking
alter_cell_sequences_rangerake if the cell is marked as a legacy.
How to set up and validate locally
-
Follow steps described in !170613 (merged). You should get the sequences range updated.
-
Change your
gitlab.yml. Update the first celllegacytotrue
cell:
id: 0
name: cell-0
skip_sequence_alteration: true
-
Run
bin/rails gitlab:db:configureorbundle exec rake "gitlab:db:alter_cell_sequences_range[0,1000]". -
Check that sequences were not changed
gdk-psql
gitlabhq_development=# SELECT DISTINCT(min_value, max_value) FROM pg_sequences WHERE schemaname = 'public';
row
------------
(1,750000)
-
Now, change your
gitlab.ymlagain. Update the first cellskip_sequence_alterationtofalse -
Run
bin/rails gitlab:db:configureorbundle exec rake "gitlab:db:alter_cell_sequences_range[0,1000]". -
Sequences now were changed
gdk-psql
gitlabhq_development=# SELECT DISTINCT(min_value, max_value) FROM pg_sequences WHERE schemaname = 'public';
row
----------
(0,1000)
(1 row)
Related to #500855 (closed)
Edited by Leonardo da Rosa