Skip to content

Set traversal_ids for every namespace

Perform the following data migration on every environment except staging, which has already completed.

return if Gitlab.staging?

Namespace.where(parent: nil).find_each do |namespace|
  TraversalHierarchy.new(namespace).sync_traversal_ids!
end

We need to take this migration slowly otherwise we risk breaking database performance.

In terms of roll out, we must proceed in this order:

  1. Enable the :sync_traversal_ids FF. Ensure the :use_traversal_ids FF is false.
  2. Wait until this migration completes.
  3. Enable the :use_traversal_ids FF
Edited by Alex Pooley