Page MenuHomePhabricator

Create a maintenance script to purge expired rows from the recentchanges table
Closed, ResolvedPublic2 Estimated Story Points

Description

The purgeOldData.php maintenance script in CheckUser contains code that purges data from the recentchanges table if the table stores the IP address used for edits.

Instead of having this code in CheckUser, we should instead have this as a maintenance script in core so that it can be used even if CheckUser is not installed. To ensure that the purgeOldData.php maintenance script is unchanged, we can call this new script as a child maintenance script.

While a job exists to purge this data, this job may not be run frequently enough on small wikis (as this only run 1/10 times that an recent changes row is saved to the database. Running the script every day will ensure that it is definitely run at least once a day (as is done through running purgeOldData.php on WMF wikis every day).

Acceptance criteria
  • Create a new maintenance script that purges expired rows from the recentchanges table.

Related Objects

StatusSubtypeAssignedTask
Resolvedkostajh
DeclinedNone
ResolvedNiharika
ResolvedMadalina
OpenNone
ResolvedDreamy_Jazz
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedSTran
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

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

[mediawiki/core@master] Create a maintenance script to purge expired rows in recentchanges

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

Change #1064454 merged by jenkins-bot:

[mediawiki/core@master] Create a maintenance script to purge expired rows in recentchanges

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

Suggested QA steps for a local wiki:

  1. Perform a few testing edits to add rows to the recentchanges table
  2. Set $wgRCMaxAge = 1; in LocalSettings.php
  3. Run the maintenance script
  4. Verify that no rows exist in the recentchanges table

This cannot be effectively QA'd on beta wikis or patch demo.

Djackson-ctr subscribed.

I have verified the new code has been implemented and is functioning, and displaying as expected (Per the QA Steps), thank you @Dreamy_Jazz for the QA Steps.

image.png (212×445 px, 9 KB)

Dreamy_Jazz updated the task description. (Show Details)