Add organization_id as sharding key for authentication_events table
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Background
The authentication_events table currently has a user_id column, but it's nullable and therefore not suitable as a sharding key. We need to add an organization_id column to properly support organization-level data sharding.
Tasks
- Add
organization_idcolumn toauthentication_eventstable - Backfill the
organization_iddata - Update
gitlab_schematogitlab_main_cell - Add
organization_idas the sharding key
Technical Details
- Target table:
authentication_events - New column:
organization_id - Schema:
gitlab_main_cell - Sharding key:
organization_id
Acceptance Criteria
-
organization_idcolumn exists inauthentication_eventstable -
Data is properly backfilled -
Column is set as not nullable -
Foreign key constraints are in place -
Sharding key is properly configured in schema definition -
All existing functionality works as expected
References
- Example schema definition:
db/docs/epics.yml - Original issue: Sharding Key Investigation for `authentication_... (#553447 - closed)
Edited by 🤖 GitLab Bot 🤖