Page MenuHomePhabricator

Dry-run fixOldLogEntries for AbuseFilter
Open, Needs TriagePublic

Description

This script will fix old log entries causing T208931.
It was introduced with https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/AbuseFilter/+/483101/ and will be included in 1.34/wmf.16.
Once it reaches production, I'd like to see the result of

fixOldLogEntries.php --dry-run --verbose

on all WMF wikis, then eventually run it for real.

Details

Related Gerrit Patches:
mediawiki/extensions/AbuseFilter : masterUpdate fixOldLogEntries
mediawiki/extensions/AbuseFilter : masterFix addMissingLogEntriesScript
mediawiki/extensions/AbuseFilter : masterfixOldLogEntries: Don't print an extra line
mediawiki/extensions/AbuseFilter : masterAesthetic changes for fixOldLogEntries script

Event Timeline

Daimona created this task.Jul 22 2019, 12:37 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 22 2019, 12:37 PM
Daimona updated the task description. (Show Details)Jul 22 2019, 12:37 PM

Do we need to run it on Beta or does it get automatically run there when updating the code? Thanks.

Do we need to run it on Beta or does it get automatically run there when updating the code? Thanks.

Yeah I guess it should be executed on Beta too. Unless it runs update.php, in which case it'll happen automatically.

It runs a full scap AIUI each ten minutes or so. I guess trying a dry-run wouldn't hurt. I can try to do it and share the results later today. I cannot do it at this moment. Sorry.

@Daimona I've ran it on deploymentwiki via mwscript. So far:

maurelio@deployment-deploy01:~$ mwscript extensions/AbuseFilter/maintenance/fixOldLogEntries.php --wiki=deploymentwiki --dry-run
FixOldLogEntries: would update 51 rows out of 51 found rows.maurelio@deployment-deploy01:~$

It looks like the script needs a line break at the end so it does not make the shell prompt to go next to the script output?

It looks like the script needs a line break at the end so it does not make the shell prompt to go next to the script output?

Done in https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/AbuseFilter/+/525058/.

51 rows seems fine, although I'm unsure what rows it found. I also see wrongly imploded stuff in 2018 logs, while the original bug only affected ~2009 entries. The script will fix them all the same, I just want to be sure it doesn't happen anymore. It seems something deploymentwiki-specific and unrelated, though.

It looks like the script needs a line break at the end so it does not make the shell prompt to go next to the script output?

Done in https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/AbuseFilter/+/525058/.

Thanks. There's that phan error now blocking the patch though. Hopefully a fix can be found soon.

51 rows seems fine, although I'm unsure what rows it found. I also see wrongly imploded stuff in 2018 logs, while the original bug only affected ~2009 entries. The script will fix them all the same, I just want to be sure it doesn't happen anymore. It seems something deploymentwiki-specific and unrelated, though.

Unless the script is modified to be more verbose and say which rows are affected I'm afraid this is what we will get running the script :-) [ or if there's any way to know which are the specific rows that are affected I am not smart enough to find out which ones ]

Thanks. There's that phan error now blocking the patch though. Hopefully a fix can be found soon.

Meh, that's an HHVM super-annoying bug.

Unless the script is modified to be more verbose and say which rows are affected I'm afraid this is what we will get running the script :-) [ or if there's any way to know which are the specific rows that are affected I am not smart enough to find out which ones ]

Yeah, let me add a --verbose option to report the IDs.

Change 525058 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Aesthetic changes for fixOldLogEntries script

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

Change 525058 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Aesthetic changes for fixOldLogEntries script

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

Daimona updated the task description. (Show Details)Jul 23 2019, 7:41 PM
maurelio@deployment-deploy01:~$ mwscript extensions/AbuseFilter/maintenance/fixOldLogEntries.php --wiki=deploymentwiki --dry-run --verbose
FixOldLogEntries: would update 51 rows out of 51 rows found.
The affected log IDs are: 15735, 15736, 15737, 15738, 15739, 15740, 15741, 15742, 15743, 15744, 15745, 15746, 15747, 15748, 15749, 15750, 15751, 23864, 23865, 23866, 23867, 23868, 23869, 23870, 23871, 23872, 23873, 23874, 23875, 23876, 23877, 23878, 23879, 23880, 23881, 23882, 23883, 23884, 23885, 23886, 23887, 23888, 23889, 23890, 23891, 23892, 23893, 23894, 23895, 23896, 23897

I'll run the same foreach and paste the results.

Mentioned in SAL (#wikimedia-releng) [2019-07-24T10:54:38Z] <hauskatze> deployment-prep Dry-running extensions/AbuseFilter/maintenance/fixOldLogEntries.php refs. T228655

Mentioned in SAL (#wikimedia-cloud) [2019-07-24T10:55:02Z] <hauskatze> Dry-running extensions/AbuseFilter/maintenance/fixOldLogEntries.php refs. T228655

Voilà:

1maurelio@deployment-deploy01:~$ foreachwiki extensions/AbuseFilter/maintenance/fixOldLogEntries.php --verbose --dry-run
2-----------------------------------------------------------------
3aawiki
4-----------------------------------------------------------------
5aawiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
6aawiki: The affected log IDs are:
7-----------------------------------------------------------------
8arwiki
9-----------------------------------------------------------------
10arwiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
11arwiki: The affected log IDs are:
12-----------------------------------------------------------------
13cawiki
14-----------------------------------------------------------------
15cawiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
16cawiki: The affected log IDs are:
17-----------------------------------------------------------------
18commonswiki
19-----------------------------------------------------------------
20commonswiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
21commonswiki: The affected log IDs are:
22-----------------------------------------------------------------
23crhwiki
24-----------------------------------------------------------------
25crhwiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
26crhwiki: The affected log IDs are:
27-----------------------------------------------------------------
28deploymentwiki
29-----------------------------------------------------------------
30deploymentwiki: FixOldLogEntries: would update 51 rows out of 51 rows found.
31deploymentwiki: The affected log IDs are: 15735, 15736, 15737, 15738, 15739, 15740, 15741, 15742, 15743, 15744, 15745, 15746, 15747, 15748, 15749, 15750, 15751, 23864, 23865, 23866, 23867, 23868, 23869, 23870, 23871, 23872, 23873, 23874, 23875, 23876, 23877, 23878, 23879, 23880, 23881, 23882, 23883, 23884, 23885, 23886, 23887, 23888, 23889, 23890, 23891, 23892, 23893, 23894, 23895, 23896, 23897
32-----------------------------------------------------------------
33dewiki
34-----------------------------------------------------------------
35dewiki: FixOldLogEntries: would update 3 rows out of 3 rows found.
36dewiki: The affected log IDs are: 17682, 17683, 17684
37-----------------------------------------------------------------
38dewiktionary
39-----------------------------------------------------------------
40dewiktionary: FixOldLogEntries: would update 0 rows out of 0 rows found.
41dewiktionary: The affected log IDs are:
42-----------------------------------------------------------------
43en_rtlwiki
44-----------------------------------------------------------------
45en_rtlwiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
46en_rtlwiki: The affected log IDs are:
47-----------------------------------------------------------------
48enwiki
49-----------------------------------------------------------------
50enwiki: FixOldLogEntries: would update 8 rows out of 8 rows found.
51enwiki: The affected log IDs are: 130871, 130872, 134816, 134817, 134818, 134819, 134820, 134821
52-----------------------------------------------------------------
53enwikibooks
54-----------------------------------------------------------------
55enwikibooks: FixOldLogEntries: would update 0 rows out of 0 rows found.
56enwikibooks: The affected log IDs are:
57-----------------------------------------------------------------
58enwikinews
59-----------------------------------------------------------------
60enwikinews: FixOldLogEntries: would update 0 rows out of 0 rows found.
61enwikinews: The affected log IDs are:
62-----------------------------------------------------------------
63enwikiquote
64-----------------------------------------------------------------
65enwikiquote: FixOldLogEntries: would update 0 rows out of 0 rows found.
66enwikiquote: The affected log IDs are:
67-----------------------------------------------------------------
68enwikisource
69-----------------------------------------------------------------
70enwikisource: FixOldLogEntries: would update 0 rows out of 0 rows found.
71enwikisource: The affected log IDs are:
72-----------------------------------------------------------------
73enwikiversity
74-----------------------------------------------------------------
75enwikiversity: FixOldLogEntries: would update 0 rows out of 0 rows found.
76enwikiversity: The affected log IDs are:
77-----------------------------------------------------------------
78enwikivoyage
79-----------------------------------------------------------------
80enwikivoyage: FixOldLogEntries: would update 0 rows out of 0 rows found.
81enwikivoyage: The affected log IDs are:
82-----------------------------------------------------------------
83enwiktionary
84-----------------------------------------------------------------
85enwiktionary: FixOldLogEntries: would update 0 rows out of 0 rows found.
86enwiktionary: The affected log IDs are:
87-----------------------------------------------------------------
88eowiki
89-----------------------------------------------------------------
90eowiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
91eowiki: The affected log IDs are:
92-----------------------------------------------------------------
93eswiki
94-----------------------------------------------------------------
95eswiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
96eswiki: The affected log IDs are:
97-----------------------------------------------------------------
98eswikibooks
99-----------------------------------------------------------------
100eswikibooks: FixOldLogEntries: would update 0 rows out of 0 rows found.
101eswikibooks: The affected log IDs are:
102-----------------------------------------------------------------
103fawiki
104-----------------------------------------------------------------
105fawiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
106fawiki: The affected log IDs are:
107-----------------------------------------------------------------
108hewiki
109-----------------------------------------------------------------
110hewiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
111hewiki: The affected log IDs are:
112-----------------------------------------------------------------
113hewiktionary
114-----------------------------------------------------------------
115hewiktionary: FixOldLogEntries: would update 0 rows out of 0 rows found.
116hewiktionary: The affected log IDs are:
117-----------------------------------------------------------------
118hiwiki
119-----------------------------------------------------------------
120hiwiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
121hiwiki: The affected log IDs are:
122-----------------------------------------------------------------
123jawiki
124-----------------------------------------------------------------
125jawiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
126jawiki: The affected log IDs are:
127-----------------------------------------------------------------
128kowiki
129-----------------------------------------------------------------
130kowiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
131kowiki: The affected log IDs are:
132-----------------------------------------------------------------
133loginwiki
134-----------------------------------------------------------------
135loginwiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
136loginwiki: The affected log IDs are:
137-----------------------------------------------------------------
138metawiki
139-----------------------------------------------------------------
140metawiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
141metawiki: The affected log IDs are:
142-----------------------------------------------------------------
143nlwiki
144-----------------------------------------------------------------
145nlwiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
146nlwiki: The affected log IDs are:
147-----------------------------------------------------------------
148ruwiki
149-----------------------------------------------------------------
150ruwiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
151ruwiki: The affected log IDs are:
152-----------------------------------------------------------------
153simplewiki
154-----------------------------------------------------------------
155simplewiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
156simplewiki: The affected log IDs are:
157-----------------------------------------------------------------
158sqwiki
159-----------------------------------------------------------------
160sqwiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
161sqwiki: The affected log IDs are:
162-----------------------------------------------------------------
163srwiki
164-----------------------------------------------------------------
165srwiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
166srwiki: The affected log IDs are:
167-----------------------------------------------------------------
168svwiki
169-----------------------------------------------------------------
170svwiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
171svwiki: The affected log IDs are:
172-----------------------------------------------------------------
173testwiki
174-----------------------------------------------------------------
175testwiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
176testwiki: The affected log IDs are:
177-----------------------------------------------------------------
178ukwiki
179-----------------------------------------------------------------
180ukwiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
181ukwiki: The affected log IDs are:
182-----------------------------------------------------------------
183wikidatawiki
184-----------------------------------------------------------------
185wikidatawiki: FixOldLogEntries: would update 0 rows out of 0 rows found.
186wikidatawiki: The affected log IDs are:
187-----------------------------------------------------------------
188zhwiki
189-----------------------------------------------------------------
190zhwiki: FixOldLogEntries: would update 35 rows out of 35 rows found.
191zhwiki: The affected log IDs are: 2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 3045, 3046, 3047, 3048, 3049
192-----------------------------------------------------------------
193zhwikivoyage
194-----------------------------------------------------------------
195zhwikivoyage: FixOldLogEntries: would update 0 rows out of 0 rows found.
196zhwikivoyage: The affected log IDs are:
197maurelio@deployment-deploy01:~$

@MarcoAurelio Thanks! Now I'm going to upload another patch to remove that extra "The affected log IDs are" line when there are no affected rows, to improve readability. Then I'll check the ones reported above. However, if there are other faulty rows from 2018, they should probably be handled separately by the script, as they seem to be duplicates with wrong parameters.

Change 525255 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] fixOldLogEntries: Don't print an extra line

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

Daimona changed the task status from Open to Stalled.Jul 24 2019, 11:39 AM

OK, so first of all, it's not so easy to see the affected rows, because it's not possible to query the logs filtering by log_id (not even with the APIs, AFAICS), and I currently cannot ssh to run the query on the DB. But I could still find most of them via API + ctrl-f. All of the affected rows on beta cluster are from 2017 or later, as I was saying above. So we have to fix them separately.

What happened is, somehow a duplicated rows was inserted with legacy parameters. For instance, this is from enwiki:

{
                "logid": 127865,
                "ns": -1,
                "title": "Special:AbuseFilter/461",
                "pageid": 0,
                "logpage": 0,
                "params": {
                    "historyId": 76,
                    "newId": "461"
                },
                "type": "abusefilter",
                "action": "modify",
                "user": "Etonkovidova",
                "timestamp": "2017-09-29T19:37:35Z",
                "comment": ""
}

And this entry is correct, see the historyId and newId params. However, right before that one we have:

{
                "logid": 130871,
                "ns": -1,
                "title": "Special:AbuseFilter/461",
                "pageid": 0,
                "logpage": 0,
                "params": {
                    "0": "76\\n461"
                },
                "type": "abusefilter",
                "action": "modify",
                "user": "Etonkovidova",
                "timestamp": "2017-09-29T19:37:34Z",
                "comment": ""
}

With params having the legacy format (single key, \n-imploded).

This bug seems now resolved, but I'm unsure about the cause. It could be internal to AF, or even withing core's logging system. I have to investigate this bug first, determine what caused it, whether it's really fixed now, and then handle it separately within the script, probably by removing the duplicated row altogether. Or at least make it use new-style params, although that will leave duplicated rows in place.

Note that the results above are not from production but from the beta cluster. I though I shall make it clearer again just in case numbers don't match. Thanks.

Note that the results above are not from production but from the beta cluster. I though I shall make it clearer again just in case numbers don't match. Thanks.

Yeah, I know. However, I believe we'll find the same bug in production. I couldn't find anything suspicious in 2017 code for AF logging, so I'll probably have to test this locally.

Change 525255 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] fixOldLogEntries: Don't print an extra line

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

Daimona changed the task status from Stalled to Open.Aug 11 2019, 3:37 PM

So, I did some tests. First of all, I cannot reproduce this locally. TBH, I didn't spend much time testing: I just pulled this AF version and used that with MW master, so it's not surprising. I ran the following:

MariaDB [deploymentwiki]> select * from logging where log_type = 'abusefilter' and log_params like '%\\\\n%' order by log_id desc limit 20;
+--------+-------------+------------+----------------+----------+----------------+-----------+---------------+----------------+----------+----------------+------------+-------------+
| log_id | log_type    | log_action | log_timestamp  | log_user | log_user_text  | log_actor | log_namespace | log_title      | log_page | log_comment_id | log_params | log_deleted |
+--------+-------------+------------+----------------+----------+----------------+-----------+---------------+----------------+----------+----------------+------------+-------------+
|  23897 | abusefilter | modify     | 20180909084319 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |     NULL |              1 | 243\n28    |           0 |
|  23896 | abusefilter | modify     | 20180826174948 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |     NULL |              1 | 242\n28    |           0 |
|  23895 | abusefilter | modify     | 20180819165232 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |     NULL |              1 | 241\n28    |           0 |
|  23894 | abusefilter | modify     | 20180729140353 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |     NULL |              1 | 240\n28    |           0 |
|  23893 | abusefilter | modify     | 20180728163107 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |     NULL |              1 | 239\n28    |           0 |
|  23892 | abusefilter | modify     | 20180728163046 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |     NULL |              1 | 238\n28    |           0 |
|  23891 | abusefilter | modify     | 20180728130620 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |     NULL |              1 | 237\n28    |           0 |
|  23890 | abusefilter | modify     | 20180713021108 |     1047 | MusikAnimal    |         3 |            -1 | AbuseFilter/13 |     NULL |              1 | 236\n13    |           0 |
|  23889 | abusefilter | modify     | 20180711112610 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |     NULL |              1 | 235\n28    |           0 |
|  23888 | abusefilter | modify     | 20180628201351 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |     NULL |              1 | 234\n28    |           0 |
|  23887 | abusefilter | modify     | 20180609091118 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |     NULL |              1 | 233\n28    |           0 |
|  23886 | abusefilter | modify     | 20180609090944 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |     NULL |              1 | 232\n28    |           0 |
|  23885 | abusefilter | modify     | 20180609090842 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |     NULL |              1 | 231\n28    |           0 |
|  23884 | abusefilter | modify     | 20180604162920 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/30 |     NULL |              1 | 230\n30    |           0 |
|  23883 | abusefilter | modify     | 20180527132928 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/30 |     NULL |              1 | 229\n30    |           0 |
|  23882 | abusefilter | modify     | 20180525124326 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/29 |     NULL |              1 | 228\n29    |           0 |
|  23881 | abusefilter | modify     | 20180525124219 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/29 |     NULL |              1 | 227\n29    |           0 |
|  23880 | abusefilter | modify     | 20180525124041 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |     NULL |              1 | 226\n28    |           0 |
|  23879 | abusefilter | modify     | 20180525124029 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |     NULL |              1 | 225\n28    |           0 |
|  23878 | abusefilter | modify     | 20180525122647 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/29 |     NULL |              1 | 224\n29    |           0 |
+--------+-------------+------------+----------------+----------+----------------+-----------+---------------+----------------+----------+----------------+------------+-------------+

Apparently, we constantly got a faulty line every time a filter was modified, until 2018-09-09. The next edit was on October 19th, so we have a ~40 days interval in which something fixed the error. It's also very weird that on production enwiki this error did not happen: entries from <2010 are the one that I meant to target with the script.


OK, so I realized what's wrong after writing the rant above (as usual). The problem lies in the addMissingLoggingEntries script (created for T54919), which adds new row using '\n' (single quotes) as separator. Depending on whether/when/where the script was executed, it's obvious that we got different results. The script also had other newline problems at its introduction, but they were fixed (although it's unclear whether any row was modified in the meanwhile).
Looking at the times I wrote in T208931#4865248, and at how I couldn't find an explanation, I now believe that the addMissingLoggingEntries script has always been the cause of this problem, for both ~2009 and ~2018 entries.

Given the amount of factors involved, some unclear points (e.g. when the script was executed and where, whether it touched any rows before newlines were fixed etc.), and the complexity of understanding something happened many years ago, I think we can avoid searching a complete explanation.
The only thing I'd like to understand is why we have 2018-08 entries on beta, since AFAICS @MarcoAurelio ran the script in February (T54919#3964726).

But anyway, given that (apparently) it's still the same problem happened in different time periods, I'm just going to write this in a comment inside the script, and then we can move on.

Oh, and of course I'm going to fix the broken script. Also, note that the script doesn't extend LoggedUpdateMaintenance, which means that it can be ran as many times as you wish.
When we switched log entries from legacy (comma-imploded numbers) to the new format (serialized array), the script stopped recognizing them, and thus it thought the rows were missing, and began to create duplicates as noted in T228655#5360754. I'm also going to fix that in the new script (removing duplicated rows).

Change 529608 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Fix addMissingLogEntriesScript

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

Change 529609 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Update fixOldLogEntries

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

Daimona changed the task status from Open to Stalled.Aug 11 2019, 4:50 PM

Back to stalled, we need both the patches above to be merged, and then I'd like to see a dry-run of the other script, so that we can add it to update.php (I'll create a separate task), and then we can resume.

The only thing I'd like to understand is why we have 2018-08 entries on beta, since AFAICS @MarcoAurelio ran the script in February (T54919#3964726).

The only possible explanation is that someone re-ran the script after that date:

MariaDB [deploymentwiki]> select * from logging where log_type = 'abusefilter' and log_params like '%243%';
+--------+-------------+------------+----------------+----------+----------------+-----------+---------------+----------------+----------+----------------+---------------------------------------------------+-------------+
| log_id | log_type    | log_action | log_timestamp  | log_user | log_user_text  | log_actor | log_namespace | log_title      | log_page | log_comment_id | log_params                                        | log_deleted |
+--------+-------------+------------+----------------+----------+----------------+-----------+---------------+----------------+----------+----------------+---------------------------------------------------+-------------+
|  23847 | abusefilter | modify     | 20180909084319 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |        0 |              1 | a:2:{s:9:"historyId";i:243;s:5:"newId";s:2:"28";} |           0 |
|  23897 | abusefilter | modify     | 20180909084319 |     4103 | Daimona Eaytoy |         2 |            -1 | AbuseFilter/28 |     NULL |              1 | 243\n28                                           |           0 |
+--------+-------------+------------+----------------+----------+----------------+-----------+---------------+----------------+----------+----------------+---------------------------------------------------+-------------+

Shows that the last entry in T228655#5408181 (and probably the others, too) is a duplicate. And in fact,

MariaDB [deploymentwiki]> select log_id, log_type, log_timestamp, IF(log_type='abusefilter',log_params,'[useless]') as log_params from logging where log_id BETWEEN 23847 AND 23897;
+--------+---------------+----------------+---------------------------------------------------+
| log_id | log_type      | log_timestamp  | log_params                                        |
+--------+---------------+----------------+---------------------------------------------------+
|  23847 | abusefilter   | 20180909084319 | a:2:{s:9:"historyId";i:243;s:5:"newId";s:2:"28";} |
|  23848 | newusers      | 20180909133412 | [useless]                                         |
|  23849 | newusers      | 20180909133547 | [useless]                                         |
|  23850 | newusers      | 20180909133715 | [useless]                                         |
|  23851 | newusers      | 20180909135605 | [useless]                                         |
|  23852 | newusers      | 20180909142257 | [useless]                                         |
|  23853 | newusers      | 20180909194030 | [useless]                                         |
|  23854 | spamblacklist | 20180909195116 | [useless]                                         |
|  23855 | newusers      | 20180910145059 | [useless]                                         |
|  23856 | newusers      | 20180910192402 | [useless]                                         |
|  23857 | newusers      | 20180911022346 | [useless]                                         |
|  23858 | newusers      | 20180911073236 | [useless]                                         |
|  23859 | newusers      | 20180912044451 | [useless]                                         |
|  23860 | newusers      | 20180912101612 | [useless]                                         |
|  23861 | newusers      | 20180912185119 | [useless]                                         |
|  23862 | newusers      | 20180912195519 | [useless]                                         |
|  23863 | newusers      | 20180915043546 | [useless]                                         |
|  23864 | abusefilter   | 20180318000558 | 210\n14                                           |
|  23865 | abusefilter   | 20180330102928 | 211\n22                                           |
|  23866 | abusefilter   | 20180330102953 | 212\n22                                           |
|  23867 | abusefilter   | 20180330120433 | 213\n28                                           |
|  23868 | abusefilter   | 20180408141500 | 214\n28                                           |
|  23869 | abusefilter   | 20180424070300 | 215\n28                                           |
|  23870 | abusefilter   | 20180424070323 | 216\n28                                           |
|  23871 | abusefilter   | 20180424070349 | 217\n28                                           |
|  23872 | abusefilter   | 20180424070405 | 218\n28                                           |
|  23873 | abusefilter   | 20180427062538 | 219\n28                                           |
|  23874 | abusefilter   | 20180427062547 | 220\n28                                           |
|  23875 | abusefilter   | 20180428150250 | 221\n28                                           |
|  23876 | abusefilter   | 20180504205626 | 222\n28                                           |
|  23877 | abusefilter   | 20180504205642 | 223\n28                                           |
|  23878 | abusefilter   | 20180525122647 | 224\n29                                           |
|  23879 | abusefilter   | 20180525124029 | 225\n28                                           |
|  23880 | abusefilter   | 20180525124041 | 226\n28                                           |
|  23881 | abusefilter   | 20180525124219 | 227\n29                                           |
|  23882 | abusefilter   | 20180525124326 | 228\n29                                           |
|  23883 | abusefilter   | 20180527132928 | 229\n30                                           |
|  23884 | abusefilter   | 20180604162920 | 230\n30                                           |
|  23885 | abusefilter   | 20180609090842 | 231\n28                                           |
|  23886 | abusefilter   | 20180609090944 | 232\n28                                           |
|  23887 | abusefilter   | 20180609091118 | 233\n28                                           |
|  23888 | abusefilter   | 20180628201351 | 234\n28                                           |
|  23889 | abusefilter   | 20180711112610 | 235\n28                                           |
|  23890 | abusefilter   | 20180713021108 | 236\n13                                           |
|  23891 | abusefilter   | 20180728130620 | 237\n28                                           |
|  23892 | abusefilter   | 20180728163046 | 238\n28                                           |
|  23893 | abusefilter   | 20180728163107 | 239\n28                                           |
|  23894 | abusefilter   | 20180729140353 | 240\n28                                           |
|  23895 | abusefilter   | 20180819165232 | 241\n28                                           |
|  23896 | abusefilter   | 20180826174948 | 242\n28                                           |
|  23897 | abusefilter   | 20180909084319 | 243\n28                                           |
+--------+---------------+----------------+---------------------------------------------------+

The entry 23847 (the original one) is from 2018-09-09, the entry 23863 is from 2018-09-15 but the next one, 23864, is from 2018-03-18, i.e. 6 months before. This means that someone re-ran the script after September 15th 2018 (we could find the exact date by looking at the next entries, but I'm too lazy). Now everything is clear.

Change 529608 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Fix addMissingLogEntriesScript

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

Change 529609 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Update fixOldLogEntries

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

Daimona changed the task status from Stalled to Open.Tue, Dec 3, 6:31 PM

Unstalling, the script can now be executed again, with --dry-run --verbose on a small wiki (or the beta cluster).