Migrate namespaces.traversal_ids from int4[] to int8[]

GitLab is undergoing a gradual process to migrate primary keys from int4 to int8. This process is documented at https://docs.gitlab.com/ee/development/database/avoiding_downtime_in_migrations.html#migrating-integer-primary-keys-to-bigint. Urgent tables have already migrated. int8 has been the standard Ruby on Rails primary key size for some years.

The namespaces.traversal_ids is an int4 array that references namespaces.id which is currently an int4. This issue is to migrate namespace.traversal_ids from an int4[] to an int8[].


The following discussion from !61974 (closed) should be addressed:

  • @ayufan started a discussion:

    @abrandl @iroussos

    I wish these things would be catched early with this _ids. I see the following:

    • in some cases I saw a mention that _id int is acceptable, as related column is int => it is not
    • _id and _ids I don't believe we cover and ensure, and enforce that these are bigint instead we rely on database review process which did not work in this case
    • I did not see anywhere a mention in our guidelines (I might be wrong here) that id should always be bigint it rather seems to be an internal untold truth

Availability and Testing

  • Please run e2e:package-and-test on related MR(s) if it is not triggered automatically. Feel free to reach out to @vburton with any questions on QA failures.
Edited by Valerie Burton