Page MenuHomePhabricator

log_search rows with ls_field='target_author_actor' and empty ls_value are created during actor migration
Closed, ResolvedPublic

Description

When the actor migration stage is set to write-both and migrateActors.php hasn't been run yet, using RevDel will create entries in log_search with ls_field='target_author_actor' and empty ls_value.

This happened on Wikimedia wikis, and so needs to be cleaned up, but should not be happening anymore since migrateActors.php has already been completed.

  • Patch MediaWiki so this won't happen anymore.
  • Fix the maintenance script's inefficient query.
  • Run maintenance to clean up existing instances of this problem on Wikimedia wikis.

This blocks setting actor migration on Wikimedia wikis to write-both/read-new.

Event Timeline

Change 488961 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] RevDel: Avoid log_search rows with empty values for target_author_actor

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

Change 488961 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] RevDel: Avoid log_search rows with empty values for target_author_actor

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

Change 488961 merged by jenkins-bot:
[mediawiki/core@master] RevDel: Avoid log_search rows with empty values for target_author_actor

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

Looks like the patch is merged. Now this needs a maintenance script to run, right?

daniel triaged this task as Medium priority.Apr 1 2019, 1:26 PM

Mentioned in SAL (#wikimedia-operations) [2019-04-02T13:44:27Z] <anomie@mwmaint1002> Fixing empty values for 'target_author_actor' in log_search on test wikis and mediawikiwiki for T215525

When running the maintenance script on mediawikiwiki, I found that a query can no longer use the indexes properly after the change made for T216247: DatabaseMysql(Base)::buildStringCast should probably actually cast. In brief, the join ON ( ls_value = CAST( actor_user AS BINARY ) ) can't use the actor_user index as intended. It needs to cast the other way instead, ON ( actor_user = CAST( ls_value AS INTEGER ) ).

Change 500754 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] MigrateActors: Improve query for log_search rows

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

Change 500754 merged by jenkins-bot:
[mediawiki/core@master] MigrateActors: Improve query for log_search rows

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

Change 500969 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@wmf/1.33.0-wmf.23] MigrateActors: Improve query for log_search rows

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

Change 500970 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@wmf/1.33.0-wmf.24] MigrateActors: Improve query for log_search rows

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

Change 500969 merged by jenkins-bot:
[mediawiki/core@wmf/1.33.0-wmf.23] MigrateActors: Improve query for log_search rows

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

Change 500970 merged by jenkins-bot:
[mediawiki/core@wmf/1.33.0-wmf.24] MigrateActors: Improve query for log_search rows

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

Mentioned in SAL (#wikimedia-operations) [2019-04-03T14:59:33Z] <anomie@mwmaint1002> Fixing empty values for 'target_author_actor' in log_search on section 1 wikis for T215525

Mentioned in SAL (#wikimedia-operations) [2019-04-03T15:00:06Z] <anomie@mwmaint1002> Fixing empty values for 'target_author_actor' in log_search on section 2 wikis for T215525

Mentioned in SAL (#wikimedia-operations) [2019-04-03T15:00:09Z] <anomie@mwmaint1002> Fixing empty values for 'target_author_actor' in log_search on remaining section 3 wikis for T215525

Mentioned in SAL (#wikimedia-operations) [2019-04-03T15:00:12Z] <anomie@mwmaint1002> Fixing empty values for 'target_author_actor' in log_search on section 4 wikis for T215525

Mentioned in SAL (#wikimedia-operations) [2019-04-03T15:00:15Z] <anomie@mwmaint1002> Fixing empty values for 'target_author_actor' in log_search on section 5 wikis for T215525

Mentioned in SAL (#wikimedia-operations) [2019-04-03T15:00:18Z] <anomie@mwmaint1002> Fixing empty values for 'target_author_actor' in log_search on section 6 wikis for T215525

Mentioned in SAL (#wikimedia-operations) [2019-04-03T15:00:21Z] <anomie@mwmaint1002> Fixing empty values for 'target_author_actor' in log_search on section 7 wikis for T215525

Mentioned in SAL (#wikimedia-operations) [2019-04-03T15:00:24Z] <anomie@mwmaint1002> Fixing empty values for 'target_author_actor' in log_search on section 8 wikis for T215525

Mentioned in SAL (#wikimedia-operations) [2019-04-03T15:00:29Z] <anomie@mwmaint1002> Fixing empty values for 'target_author_actor' in log_search on wikitech for T215525

Anomie updated the task description. (Show Details)

Script run and results checked.