Convert int4 PKs to int8
For GitLab.com, the procedure of converting int4 surrogate primary keys to int8 is needed to avoid hitting 2^31 limit, w/o or with very short (minutes) downtime.
The same procedure might be needed for other GitLab instances in the future.
Epic: &14
Initial proposals: https://docs.google.com/document/u/6/d/193a1P4YFZOnNrQhR9MNg3UTFR20a4CSyU51Fz4KbwS8/edit?usp=sharing
Related: https://gitlab.com/gitlab-org/gitlab-ce/issues/50886
Current state of sequences on int2-, int4-PKs: https://gitlab.com/gitlab-org/gitlab-ce/issues/50886#note_125700349
The primary tools being considered:
- pg_repack with slightly patched plpgsql code and with additional metadata conversion (initial PoC: https://gitlab.com/gitlab-org/gitlab-ce/issues/50886#note_124221343, also discussed here: https://github.com/reorg/pg_repack/issues/197)
Edited by Nikolay Samokhvalov