Skip to content

Add sharding key to raw_usage_data table for Cells 1.0 compliance

What does this MR do and why?

With moving to Cells 1.0 we need to add sharding key to raw_usage_data table.

The table is and edge case:

  1. For self-manage installations the entries are generated for the entire instance.
  2. For Gitlab.com RawUsageData is not used at all (the latest entry in the DB dated 2023-03 since we dont generate Usage Data on Gitlab.com.

So the solution is to link all entries to default organization. It lets us to backfill all the existing records on gitlab.com and all the new records on self-manage instances will be link to default org as well.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Generate UsageData:

> GitlabServicePingWorker.new.perform
> RawUsageData.last.organization_id
=> 1

Related to #442283 (closed)

Edited by Niko Belokolodov

Merge request reports