Page MenuHomePhabricator

Run PopulateCulActor on all wikis
Closed, ResolvedPublic

Description

Can I trick anyone into running populateCulActor.php on all wikis?

I don't have the access to do it myself.

The script goes through the cu_log table where cul_actor = 0 and fills up the actor id. The final result is that the cul_actor column is fully populated.

The script was added in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CheckUser/+/817248. If anyone has any functionality questions, feel free to ask them.

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
ResolvedZabe
ResolvedZabe

Event Timeline

reedy@deploy1002:/srv/mediawiki-staging/php-1.40.0-wmf.14$ mwscript extensions/CheckUser/maintenance/populateCulActor.php --wiki=testwiki
Processed 200 rows out of 1267.
Processed 200 rows out of 1267.
Processed 200 rows out of 1267.
Processed 200 rows out of 1267.
Processed 200 rows out of 1267.
Processed 200 rows out of 1267.
Processed 200 rows out of 1267.
Done. Migration failed for 10 row(s).

Do we care about failures?

From what I can tell... The 10 rows where cu_actor = 0... One was definitely renamed, and the other I'm guessing was a rename too (EDIT: Yeah, both are renames)

In both cases, the cul_user (user id) column in cu_log can be used to work out the actual user...

Should we be doing so? I'm guessing the renames predate the MediaWiki-User-rename SQL hooks being in the extension...

If the renames were done now, the cul_user_text would've been updated to the new username.

I'm guessing the intention (like everywhere else) is to eventually drop the cul_user and cul_user_text and use cul_actor going forward... Fixing these rows before they're broken seems fruitful?

I'm guessing the renames predate the MediaWiki-User-rename SQL hooks being in the extension...

rECHU7b16c55a4a0d: Update cu_changes and cu_log tables when a user is renamed is Jan 2016.

The rows not migrated definitely preadate this.

Change 869165 had a related patch set uploaded (by Zabe; author: Zabe):

[mediawiki/extensions/CheckUser@master] populateCulActor: fetch user name from user id

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

Change 869165 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] populateCulActor: fetch user name from user id

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

Change 868878 had a related patch set uploaded (by Reedy; author: Zabe):

[mediawiki/extensions/CheckUser@REL1_39] populateCulActor: fetch user name from user id

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

Change 868879 had a related patch set uploaded (by Reedy; author: Zabe):

[mediawiki/extensions/CheckUser@REL1_38] populateCulActor: fetch user name from user id

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

Change 868879 abandoned by Reedy:

[mediawiki/extensions/CheckUser@REL1_38] populateCulActor: fetch user name from user id

Reason:

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

Change 868878 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@REL1_39] populateCulActor: fetch user name from user id

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

Looks like the fix works:

taavi@mwmaint1002 ~ $ mwscript extensions/CheckUser/maintenance/populateCulActor.php --wiki=testwiki --force
Processed 200 rows out of 1268.
Processed 200 rows out of 1268.
Processed 200 rows out of 1268.
Processed 200 rows out of 1268.
Processed 200 rows out of 1268.
Processed 200 rows out of 1268.
Processed 200 rows out of 1268.
Done. Migration failed for 0 row(s).
wikiadmin@10.64.132.14(testwiki)> select count(*) from cu_log where cul_actor = 0;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.001 sec)

Mentioned in SAL (#wikimedia-operations) [2023-01-10T14:36:53Z] <zabe> run populateCulActor on group0 wikis # T325484

Mentioned in SAL (#wikimedia-operations) [2023-01-10T17:51:45Z] <zabe> run populateCulActor on all wikis # T325484

Zabe claimed this task.

This script ran successfully on all wikis except eswiki, enwikinews, enwikiversity, kawiki and xalwiki. The script crashed on those wikis, because they had pre-2008 log entries from users who got renamed and where cu did not pick up those renames. I fixed those entries up by hand (see P42959, P42960, P42961, P42966 and P42967). After that I ran the script again in the named wikis, which worked without problems.