Page MenuHomePhabricator

Update CheckUser prune job to remove client hint data
Closed, ResolvedPublic

Description

Similar to T337943 the CheckUser prune job (checkuserPruneCheckUserDataJob) should also remove client hint data. The prune job is triggered on average 1/10 times a RecentChanges entry is saved and deletes expired entries in a similar way to maintenance/purgeOldData but doesn't prune the recentchanges table.

The job definition is at src/Jobs/PruneCheckUserDataJob.php.

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptJul 3 2023, 11:18 AM

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

[mediawiki/extensions/CheckUser@master] [WIP] clienthints: Purge expired client hint data

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

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

[operations/mediawiki-config@master] Disable purging of old client hint data by default

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

Change 936055 merged by jenkins-bot:

[operations/mediawiki-config@master] Disable purging of old client hint data by default

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

Mentioned in SAL (#wikimedia-operations) [2023-07-06T20:06:31Z] <thcipriani@deploy1002> Started scap: Backport for [[gerrit:936055|Disable purging of old client hint data by default (T340959 T341076)]]

Mentioned in SAL (#wikimedia-operations) [2023-07-06T20:07:54Z] <thcipriani@deploy1002> thcipriani and dreamyjazz: Backport for [[gerrit:936055|Disable purging of old client hint data by default (T340959 T341076)]] synced to the testservers: mwdebug2001.codfw.wmnet, mwdebug1002.eqiad.wmnet, mwdebug2002.codfw.wmnet, mwdebug1001.eqiad.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-07-06T20:16:40Z] <thcipriani@deploy1002> Finished scap: Backport for [[gerrit:936055|Disable purging of old client hint data by default (T340959 T341076)]] (duration: 10m 08s)

Change 935776 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] clienthints: Purge expired client hint data

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

Suggested QA steps:

  • Reduce $wgCUDMaxAge to a small enough value for the test
  • Empty cu_useragent_clienthints_map and cu_useragent_clienthints for the test
  • Make some test edits
  • Inspect cu_useragent_clienthints_map and check that rows exist
  • Modify Hooks::maybePruneIPData to temporarily comment out the if statement, such that when this method is called ::pruneIPData is always called.
  • Wait until these edits were made over $wgCUDMaxAge seconds old
  • Make a test edit and record the revision ID of this edit
  • Inspect cu_useragent_clienthints_map and check that the only rows have uachm_reference_id as the revision ID of the test edit.

@Dreamy_Jazz I had no issues with the test steps above and the rows match with the revision id of the test edit as seen in the screenshots. I will move this to Done. Thanks for all your work and help!

T340959_CheckUser_ClientHintData_ModifyPrune1.png (479ร—870 px, 62 KB)

T340959_CheckUser_ClientHintData_ModifyPrune2.png (1ร—1 px, 197 KB)

T340959_CheckUser_ClientHintData_ModifyPrune3.png (493ร—1 px, 142 KB)