From a quick analysis on T179131, it seems that at least some of the AbuseFilter indexes are incorrect in production (at least on enwiki)
enwiki has
mysql:wikiadmin@db1066 [enwiki]> show indexes from abuse_filter_log; +------------------+------------+----------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +------------------+------------+----------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | abuse_filter_log | 0 | PRIMARY | 1 | afl_id | A | 19022925 | NULL | NULL | | BTREE | | | | abuse_filter_log | 1 | afl_timestamp | 1 | afl_timestamp | A | 19022925 | NULL | NULL | | BTREE | | | | abuse_filter_log | 1 | afl_namespace | 1 | afl_namespace | A | 4264 | NULL | NULL | | BTREE | | | | abuse_filter_log | 1 | afl_namespace | 2 | afl_title | A | 6340975 | NULL | NULL | | BTREE | | | | abuse_filter_log | 1 | afl_ip | 1 | afl_ip | A | 2377865 | NULL | NULL | | BTREE | | | | abuse_filter_log | 1 | afl_rev_id | 1 | afl_rev_id | A | 9511462 | NULL | NULL | YES | BTREE | | | | abuse_filter_log | 1 | afl_log_id | 1 | afl_log_id | A | 2 | NULL | NULL | YES | BTREE | | | | abuse_filter_log | 1 | user_timestamp | 1 | afl_user | A | 6340975 | NULL | NULL | | BTREE | | | | abuse_filter_log | 1 | user_timestamp | 2 | afl_user_text | A | 19022925 | NULL | NULL | | BTREE | | | | abuse_filter_log | 1 | user_timestamp | 3 | afl_timestamp | A | 19022925 | NULL | NULL | | BTREE | | | | abuse_filter_log | 1 | afl_filter | 1 | afl_filter | A | 56615 | NULL | NULL | | BTREE | | | | abuse_filter_log | 1 | afl_filter | 2 | afl_timestamp | A | 19022925 | NULL | NULL | | BTREE | | | +------------------+------------+----------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ 12 rows in set (0.00 sec)
It should have had the changes below applied
ALTER TABLE /*_*/abuse_filter_log ADD KEY filter_timestamp (afl_filter,afl_timestamp); ALTER TABLE /*_*/abuse_filter_log ADD KEY user_timestamp (afl_user,afl_user_text,afl_timestamp); ALTER TABLE /*_*/abuse_filter_log ADD KEY page_timestamp (afl_namespace, afl_title, afl_timestamp); ALTER TABLE /*_*/abuse_filter_log ADD KEY ip_timestamp (afl_ip, afl_timestamp); ALTER TABLE /*_*/abuse_filter_log ADD KEY wiki_timestamp (afl_wiki, afl_timestamp); ALTER TABLE /*_*/abuse_filter_log DROP KEY afl_filter; ALTER TABLE /*_*/abuse_filter_log DROP KEY afl_user; ALTER TABLE /*_*/abuse_filter_log DROP KEY afl_namespace; ALTER TABLE /*_*/abuse_filter_log DROP KEY afl_ip;
Meaning the resultant table should look like
CREATE TABLE /*$wgDBprefix*/abuse_filter_log ( afl_id BIGINT unsigned NOT NULL AUTO_INCREMENT, afl_filter varchar(64) binary NOT NULL, afl_user BIGINT unsigned NOT NULL, afl_user_text varchar(255) binary NOT NULL, afl_ip varchar(255) not null, afl_action varbinary(255) not null, afl_actions varbinary(255) not null, afl_var_dump BLOB NOT NULL, afl_timestamp binary(14) NOT NULL, afl_namespace int NOT NULL, afl_title varchar(255) binary NOT NULL, afl_wiki varchar(64) binary NULL, afl_deleted tinyint(1) NOT NULL DEFAULT 0, afl_patrolled_by int unsigned NULL, afl_rev_id int unsigned, afl_log_id int unsigned, PRIMARY KEY (afl_id), KEY filter_timestamp (afl_filter,afl_timestamp), KEY user_timestamp (afl_user,afl_user_text,afl_timestamp), KEY (afl_timestamp), KEY page_timestamp (afl_namespace, afl_title, afl_timestamp), KEY ip_timestamp (afl_ip, afl_timestamp), KEY (afl_rev_id), KEY (afl_log_id), KEY wiki_timestamp (afl_wiki, afl_timestamp) ) /*$wgDBTableOptions*/;
ALTER table to run:
ALTER TABLE /*_*/abuse_filter_log ADD KEY IF NOT EXISTS filter_timestamp (afl_filter,afl_timestamp), ADD KEY IF NOT EXISTS user_timestamp (afl_user,afl_user_text,afl_timestamp), ADD KEY IF NOT EXISTS page_timestamp (afl_namespace, afl_title, afl_timestamp), ADD KEY IF NOT EXISTS ip_timestamp (afl_ip, afl_timestamp), ADD KEY IF NOT EXISTS wiki_timestamp (afl_wiki, afl_timestamp),DROP KEY IF EXISTS afl_filter, DROP KEY IF EXISTS afl_user, DROP KEY IF EXISTS afl_namespace, DROP KEY IF EXISTS afl_ip;
Execution progress:
s1
- eqiad progress T187295#4983636
- codfw
s2
- eqiad progress T187295#4980098
- codfw
s3
- eqiad progress T187295#4990454
- codfw
s4
- eqiad progress T187295#4990424
- codfw
s5
- eqiad progress T187295#4979593
- codfw
s6
- eqiad progress T187295#4979822
- codfw progress
s7
- eqiad progress T187295#4988192
- codfw
s8
wikidatawiki already has the right schema
wikitech alread has the right schema.