Page MenuHomePhabricator

Add a new field, rc_source, to the recentchanges table on wmf wikis
Closed, ResolvedPublic

Description

Short description:

Add a new field which will be replacing rc_type to allow various sources of recentchanges rows to identify themselves without requiring registration for a numeric constant.

We will not be migrating any existing data into this field, rather we will let it run for a month with the linked patch until the time based pruning of recentchanges deletes all rows that do not have the new field populated.

Which wikis are affected:

all

Which tables:

recentchanges

What is the change to those tables:

ALTER TABLE recentchanges ADD rc_source VARBINARY(16) NULL DEFAULT
NULL;

Links to gerrit changes and/or other related bug reports.

https://gerrit.wikimedia.org/r/#/c/85787/

  • This change is accepted from an engineering fstandpoint, now ready for production db to be updated.

Version: unspecified
Severity: normal

Details

Reference
bz55844

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:13 AM
bzimport set Reference to bz55844.

Schema change has been applied to all WMF wikis.

(In reply to comment #1)

Schema change has been applied to all WMF wikis.

Apparently not, making gerrit 93117 necessary:

[19:14:27] <grrrit-wm> (\x0303Merged\x03) \x0310\x02jenkins-bot\x02\x03: testwiki and test2wiki to 1.23wmf2 [operations/mediawiki-config] - \x0310https://gerrit.wikimedia.org/r/93093\x03 (owner: \x0310\x02Reedy\x02\x03)
...
[19:37:10] <marktraceur> Reedy: Database error on trying to upload to testwiki
[19:37:22] <marktraceur> "1054 Unknown column 'rc_source' in 'field list' (10.64.16.27)"
...
[20:06:02] <Reedy> echo "explain recentchanges;" | sudo -u apache foreachwiki sql.php | grep -c rc_source
...
[20:44:33] <Reedy> reedy@tin:/a/common$ grep -c rc_source rc.sql
[20:44:33] <Reedy> 158
[20:44:33] <Reedy> reedy@tin:/a/common$ grep -c rc_params rc.sql
[20:44:33] <Reedy> 879
[20:44:33] <Reedy> reedy@tin:/a/common$
[20:44:41] <aude> hmmmm
[20:45:15] <Reedy> where rc.sql is the output from explain recentchanges; via sql.php
...
[22:03:25] <Reedy> http://p.defau.lt/?zCJx0jvocevdune_nLymMg
[22:03:26] <Reedy> That's the list
[22:04:13] <aude> strange
[22:05:28] <Reedy> It's not even all the wikipedias

Of the listed wikis, testwiki, test2wiki, mediawikiwiki, and testwikidatawiki only have the new column because Reedy added it using ALTER TABLE.

This was a bug in the OSC wrapper script used to feed our all.dblist to pt-online-schema-change, where it (correctly) aborted in certain conditions yet did not log the fact sufficiently well.

The script has been fixed plus an extra audit stage added, and then rerun on recentchanges.rc_source. All wikis now have that field.

Is this fixed as per your last comment, or is there more work left to do?

No reply. Assuming the reopening reason in comment 2 was fixed by comment 3, and closing again.