Page MenuHomePhabricator

Create temporary column in cu_changes to assist in migration to the new tables
Closed, ResolvedPublic

Description

To achieve the parent task, it is a better plan that there be a period where writing is enabled for both in case that read new needs to be disabled. To achieve this CheckUser needs to be able to filter out duplicate rows (ones that are present in cu_changes and one of cu_log_event or cu_private_event).

This can be done by adding to cu_changes:

  • Two columns that store an ID to the cu_log_event and cu_private_event tables; or
  • One column that says the column also exists in another table.

Which method to use depends on whether there is a need to link the two rows at any point. This will be investigated.

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

Dreamy_Jazz triaged this task as Medium priority.Feb 5 2023, 7:22 PM
Dreamy_Jazz moved this task from Unsorted to Add / Create on the Schema-change board.

The need to link the duplicate rows is probably not a necessity as:

  • The migration scripts would just delete the cu_changes rows once run
  • The UnionSelectQueryBuilder would only need to know if the row is duplicated. If it is then the one from cu_changes would never be selected, leaving only the one from either cu_log_event or cu_private_event
  • Whether the row is a duplicate would be determined at INSERT time for all three tables.

Change 886481 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Add cuc_only_for_read_old to cu_changes to assist in migration

https://gerrit.wikimedia.org/r/886481

Dreamy_Jazz renamed this task from Create temporary columns in cu_changes to assist in migration to the new tables to Create temporary column in cu_changes to assist in migration to the new tables.Feb 8 2023, 3:43 PM

Change 886481 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Add cuc_only_for_read_old to cu_changes to assist in migration

https://gerrit.wikimedia.org/r/886481

While the column is not yet on all WMF DBs, the migration config will prevent writing to this new column (this column will only be specified with a value when write new is set).