Draft: CI: Enable cell sequence range simulation to catch bigint overflow
What does this MR do and why?
CI: Enable cell sequence range simulation to catch bigint overflow
- Extract reusable alter_sequences_range task from cell-specific version
- Configure db:migrate:reset to simulate cell-2 sequence ranges (100B-200B)
- Surface potential integer column overflow issues before production
Draft?
-
Add specs for the new rake task
References
How to set up and validate locally
- Reset database -
bundle exec rake db:drop db:setup - Check current min/max values.
gdk psql
gitlabhq_development=# SELECT DISTINCT min_value, max_value FROM pg_sequences ORDER BY min_value, max_value;
min_value | max_value
-----------+---------------------
1 | 9223372036854775807
1000 | 9223372036854775807
(2 rows)
- Apply sequence ranges to simulate a cell (
cell-2)
$ bundle exec gitlab:db:alter_sequences_range[100_000_000_001,200_000_000_000]
- Re-check current min/max values.
gdk psql
gitlabhq_development=# SELECT DISTINCT min_value, max_value FROM pg_sequences ORDER BY min_value, max_value;
min_value | max_value
--------------+--------------
100000000001 | 200000000000
(1 row)
- Seed database via
bundle exec rake db:seed_fu - No errors
✅
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Peter Leitzen