Page MenuHomePhabricator

Populate afl_ip_hex for pre-existing abuse_filter_log rows
Closed, ResolvedPublic

Description

Summary

The abuse_filter_log table has a new afl_ip_hex column. We should populate it using the values from afl_ip to assist in the migration described at T395612: AbuseFilter abuse_filter_log table: Store IP addresses as hex values

Background & Technical details

  • T391322: Special:AbuseLog: Support search by IP and IP range when temporary accounts are enabled requests that it be possible to search AbuseFilter log entries performed by temporary accounts by the IP address used to perform the action
  • To achieve this we need to be able to search by the IP address column in the abuse_filter_log table
    • This involves populating this new afl_ip_hex column for pre-existing entries, which will be the focus of this task. This will be done via a maintenance script run in update.php.
      • We only need to populate afl_ip_hex if afl_ip contains anything other than an empty string. All entries from over 3 months ago on WMF wikis will have afl_ip as an empty string, so the population should not take too long.

Acceptance criteria

  • The afl_ip_hex column is populated for all pre-existing rows as specified above
  • Run the associated maintenance script on all WMF wikis

Event Timeline

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

[mediawiki/extensions/AbuseFilter@master] Populate afl_ip_hex in abuse_filter_log for pre-existing rows

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

Change #1168249 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Populate afl_ip_hex in abuse_filter_log for pre-existing rows

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

Should this be "In progress" as the next step is running the maintenance script?

Should this be "In progress" as the next step is running the maintenance script?

Sure. I think @STran said they would take it on from here once the patch is deployed everywhere (and so then the script can be run)

Mentioned in SAL (#wikimedia-operations) [2025-07-18T14:02:29Z] <Dreamy_Jazz> Running foreachwiki AbuseFilter:PopulateAbuseFilterLogIPHex.php --batch-size 1000 --sleep 1 for T397842

Mentioned in SAL (#wikimedia-operations) [2025-07-18T14:05:33Z] <Dreamy_Jazz> Running foreachwiki AbuseFilter:PopulateAbuseFilterLogIPHex.php for T397842