Skip to content

Inconsistency between namespace_id and project_namespace_id

@smaglangit @chen-gitlab I think we have a potential bug here for some tables.

Background

There is a subtle difference between projects.namespace_id and projects.project_namespace_id.

gitlabhq_development=# select namespace_id, project_namespace_id from projects where id = 1;
 namespace_id | project_namespace_id 
--------------+----------------------
           22 |                   23

It is not OK to use projects.namespace_id to backpopulate sharding key values. For example design_management_designs.

Problem

A project can be transferred to another group. When that happens the projects.namespace_id is updated to a different value.

So now the design_management_designs.namespace_id value is not consistent anymore.

Action items

  • Fix all triggers, values and columns to design_management* tables to use Project#project_namespace_id, not Project#namespace_id
Edited by Thong Kuah