Update gitlab_schema for table historical_data

This is an action from the sharding effort of table historial_data. More information about cell, sharding could be found from the related links in issue: Sharding Key Investigation for `historical_data... (#553459 - closed)

Per discussion here: #553459 (comment 2616848570), we think the table historical_data should belong to organization.

To shard historical_data table, we need to take several actions: 1. Create new column organization_id in table historical_data 2. update gitlab_schema: gitlab_main_cell (BTW: I like the new name gitlab_main_org more) and set the sharding key as organization_id: organizations

With the introduction of gitlab_main_cell_local, we have two placement options for historical_data:

  1. Organization-scoped: define historical_data at the organization level.
    • This was the original proposal in this issue description.
    • gitlab_schema: gitlab_main_org
    • 👎 requires code changes(adding new column, updating Historical data related query)
    • We will NOT receive Gitlab.com cell HistoricalData any more. --- Changed behaviour. Is this OK?
  2. Cell-scoped: define historical_data at the cell level.
    • gitlab_schema: gitlab_main_cell_local
    • 👍 no code changes required. Existing code should work as is.
    • 👍 We will continue to receive Gitlab.com cell HistoricalData. -- No behaviour change.
    • 👍 More consistent to the unique instance id concept

Comparing the above two options, I now prefer the option 2 Cell-scoped: define historical_data at the cell level. This means, we need to set gitlab_schema: gitlab_main_cell_local for historical_data. There is no other changes required(no need to add organization_id to historical_data table).

Edited by 🤖 GitLab Bot 🤖