Page MenuHomePhabricator

Migrate afl_filter to afl_filter_id and afl_global
Open, Needs TriagePublic

Description

This task is for tracking the migration (T220791) on WMF wikis.

Steps

  • Create the new schema
  • Merge r459818
  • Set the Beta Cluster migration stage to SCHEMA_COMPAT_WRITE_OLD | SCHEMA_COMPAT_READ_OLD
  • Set the Beta Cluster migration stage to SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
  • Let the migration script run automatically on the Beta Cluster
  • Set the Beta Cluster migration stage to SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_NEW
  • Set the migration stage to SCHEMA_COMPAT_WRITE_OLD | SCHEMA_COMPAT_READ_OLD (r647091)
  • Set the migration stage to SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD (r647116)
  • Run the migration script (T269713)
  • Set the Beta Cluster migration stage to SCHEMA_COMPAT_NEW
  • Set the migration stage to SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_NEW (657695)
  • Ensure there are no issues
  • Set the migration stage to SCHEMA_COMPAT_NEW (657696)
  • Make SCHEMA_COMPAT_NEW the extension default
  • Stop setting the migration stage (657697)

Event Timeline

Daimona created this task.Dec 8 2020, 9:51 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 8 2020, 9:51 PM

Change 647091 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[operations/mediawiki-config@master] Explicitly set wgAbuseFilterAflFilterMigrationStage

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

Daimona updated the task description. (Show Details)Dec 8 2020, 10:09 PM

Do we want to use this task for Beta Cluster migration too (for testing), or as a distinct task?

Do we want to use this task for Beta Cluster migration too (for testing), or as a distinct task?

I think it can be used for the Beta Cluster as well (like the subtask for the script included Beta Cluster), mainly because I don't expect a difficult migration like T213006 (last famous words...)

Change 647116 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[operations/mediawiki-config@master] wgAbuseFilterAflFilterMigrationStage: Make WRITE_BOTH everywhere

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

Change 647117 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[operations/mediawiki-config@master] wgAbuseFilterAflFilterMigrationStage: Make READ_NEW in Beta Cluster

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

Change 647118 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[operations/mediawiki-config@master] wgAbuseFilterAflFilterMigrationStage: Make COMPAT_NEW in Beta Cluster

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

Change 647091 merged by jenkins-bot:
[operations/mediawiki-config@master] Explicitly set wgAbuseFilterAflFilterMigrationStage

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

Mentioned in SAL (#wikimedia-operations) [2020-12-09T01:07:58Z] <jforrester@deploy1001> Synchronized wmf-config/InitialiseSettings.php: Explicitly set wgAbuseFilterAflFilterMigrationStage ahead of train roll-out T269712 (duration: 01m 03s)

jforrester@deployment-deploy01:/srv/mediawiki-staging/php-master$ mwscript extensions/AbuseFilter/maintenance/migrateAflFilter.php --wiki=metawiki --batch-size=1000 --dry-run
... processing afl_id's from 1 to 1000
... processing afl_id's from 1001 to 2000
... processing afl_id's from 2001 to 3000
... processing afl_id's from 3001 to 4000
... processing afl_id's from 4001 to 5000
... processing afl_id's from 5001 to 6000
Found 5527 rows to migrate in abuse_filter_log
jforrester@deployment-deploy01:/srv/mediawiki-staging/php-master$ mwscript extensions/AbuseFilter/maintenance/migrateAflFilter.php --wiki=metawiki --batch-size=1000
... processing afl_id's from 1 to 1000
InvalidArgumentException from line 2695 of /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/Database.php: $startPosition must be a positive integer
#0 /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/Database.php(2673): Wikimedia\Rdbms\Database->assertBuildSubstringParams(0, 7)
#1 /srv/mediawiki-staging/php-master/extensions/AbuseFilter/maintenance/migrateAflFilter.php(103): Wikimedia\Rdbms\Database->buildSubstring('afl_filter', 0, 7)
#2 /srv/mediawiki-staging/php-master/maintenance/includes/LoggedUpdateMaintenance.php(45): MigrateAflFilter->doDBUpdates()
#3 /srv/mediawiki-staging/php-master/maintenance/doMaintenance.php(106): LoggedUpdateMaintenance->execute()
#4 /srv/mediawiki-staging/php-master/extensions/AbuseFilter/maintenance/migrateAflFilter.php(135): require_once('/srv/mediawiki-...')
#5 /srv/mediawiki-staging/multiversion/MWScript.php(101): require_once('/srv/mediawiki-...')
#6 {main}

Joy.

Jdforrester-WMF changed the task status from Open to Stalled.Dec 9 2020, 1:20 AM

Next error:

jforrester@deployment-deploy01:/srv/mediawiki-staging/php-master$ mwscript extensions/AbuseFilter/maintenance/migrateAflFilter.php --wiki=metawiki --batch-size=10
... processing afl_id's from 1 to 10
... processing afl_id's from 11 to 20
... processing afl_id's from 21 to 30
... processing afl_id's from 31 to 40
... processing afl_id's from 41 to 50
... processing afl_id's from 51 to 60
... processing afl_id's from 61 to 70
... processing afl_id's from 71 to 80
... processing afl_id's from 81 to 90
... processing afl_id's from 91 to 100
... processing afl_id's from 101 to 110
... processing afl_id's from 111 to 120
... processing afl_id's from 121 to 130
... processing afl_id's from 131 to 140
... processing afl_id's from 141 to 150
... processing afl_id's from 151 to 160
... processing afl_id's from 161 to 170
... processing afl_id's from 171 to 180
Wikimedia\Rdbms\DBQueryError from line 1699 of /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/Database.php: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AS SIGNED ) WHERE afl_id IN ('178','179','180')' at line 1 (172.16.5.170:3306)
Function: MigrateAflFilter::doDBUpdates
Query: UPDATE  `abuse_filter_log` SET afl_filter_id = CAST( REPLACE(afl_filter, 'global-', '') AS SIGNED ),afl_global = CAST( (SUBSTRING(afl_filter FROM 1 FOR 7) = global- ) AS SIGNED ) WHERE afl_id IN ('178','179','180')

#0 /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/Database.php(1683): Wikimedia\Rdbms\Database->getQueryException('You have an err...', 1064, 'UPDATE  `abuse_...', 'MigrateAflFilte...')
#1 /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/Database.php(1658): Wikimedia\Rdbms\Database->getQueryExceptionAndLog('You have an err...', 1064, 'UPDATE  `abuse_...', 'MigrateAflFilte...')
#2 /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/Database.php(1227): Wikimedia\Rdbms\Database->reportQueryError('You have an err...', 1064, 'UPDATE  `abuse_...', 'MigrateAflFilte...', false)
#3 /srv/mediawiki-staging/php-master/includes/libs/rdbms/database/Database.php(2457): Wikimedia\Rdbms\Database->query('UPDATE  `abuse_...', 'MigrateAflFilte...', 128)
#4 /srv/mediawiki-staging/php-master/extensions/AbuseFilter/maintenance/migrateAflFilter.php(113): Wikimedia\Rdbms\Database->update('`abuse_filter_l...', Array, 'afl_id IN ('178...', 'MigrateAflFilte...')
#5 /srv/mediawiki-staging/php-master/maintenance/includes/LoggedUpdateMaintenance.php(45): MigrateAflFilter->doDBUpdates()
#6 /srv/mediawiki-staging/php-master/maintenance/doMaintenance.php(106): LoggedUpdateMaintenance->execute()
#7 /srv/mediawiki-staging/php-master/extensions/AbuseFilter/maintenance/migrateAflFilter.php(135): require_once('/srv/mediawiki-...')
#8 /srv/mediawiki-staging/multiversion/MWScript.php(101): require_once('/srv/mediawiki-...')
#9 {main}

Whoops, there's a missing quote.

The weird part is, I'm sure I had tested this script locally some time ago and it worked...

Whoops, there's a missing quote.

The weird part is, I'm sure I had tested this script locally some time ago and it worked...

Did this get fixed?

Whoops, there's a missing quote.

The weird part is, I'm sure I had tested this script locally some time ago and it worked...

Did this get fixed?

Yes, with r647192, which I apparently forgot to link to this task.

Urbanecm changed the task status from Stalled to Open.Jan 18 2021, 2:12 AM
Urbanecm updated the task description. (Show Details)
Urbanecm added a subscriber: Urbanecm.

hopefully not stalled anymore

Change 647116 merged by jenkins-bot:
[operations/mediawiki-config@master] wgAbuseFilterAflFilterMigrationStage: Make WRITE_BOTH everywhere

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

Mentioned in SAL (#wikimedia-operations) [2021-01-19T12:32:16Z] <urbanecm@deploy1001> Synchronized wmf-config/InitialiseSettings.php: 338c0f9fe32512266c3030f7c9b7f8804ed30432: wgAbuseFilterAflFilterMigrationStage: Make WRITE_BOTH everywhere (T269712) (duration: 00m 56s)

Change 647117 merged by jenkins-bot:
[operations/mediawiki-config@master] wgAbuseFilterAflFilterMigrationStage: Make READ_NEW in Beta Cluster

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

Daimona updated the task description. (Show Details)Jan 19 2021, 12:42 PM

Change 647118 merged by jenkins-bot:
[operations/mediawiki-config@master] wgAbuseFilterAflFilterMigrationStage: Make COMPAT_NEW in Beta Cluster

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

Change 657694 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[operations/mediawiki-config@master] wgAbuseFilterAflFilterMigrationStage: Set READ_NEW everywhere

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

Change 657695 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[operations/mediawiki-config@master] wgAbuseFilterAflFilterMigrationStage: Make READ_NEW in production

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

Change 657696 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[operations/mediawiki-config@master] wgAbuseFilterAflFilterMigrationStage: Make COMPAT_NEW in production

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

Change 657697 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[operations/mediawiki-config@master] wgAbuseFilterAflFilterMigrationStage: Stop setting, COMPAT_NEW is default

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

Change 657694 abandoned by Urbanecm:
[operations/mediawiki-config@master] wgAbuseFilterAflFilterMigrationStage: Set READ_NEW everywhere

Reason:

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

Change 657698 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/AbuseFilter@master] Make default wgAbuseFilterAflFilterMigrationStage SCHEMA_COMPAT_NEW

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

Change 657695 merged by jenkins-bot:
[operations/mediawiki-config@master] wgAbuseFilterAflFilterMigrationStage: Make READ_NEW in production

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

Mentioned in SAL (#wikimedia-operations) [2021-02-04T19:18:32Z] <urbanecm@deploy1001> Synchronized wmf-config/InitialiseSettings.php: 74e7f70c7c8ae4c8ee9589262d088562c7274b98: wgAbuseFilterAflFilterMigrationStage: Make READ_NEW in production (T269712) (duration: 01m 11s)

Daimona updated the task description. (Show Details)Thu, Feb 4, 7:36 PM

Who "ensure[s] there are no issues"? :-)

Who "ensure[s] there are no issues"? :-)

I'd take it as "let's wait a week or two and see if somebody shows up complaining about AbuseFilter being broken"

Who "ensure[s] there are no issues"? :-)

I'd take it as "let's wait a week or two and see if somebody shows up complaining about AbuseFilter being broken"

Sounds good.