Page MenuHomePhabricator

Fix localuser rows with lu_local_id=0 or lu_global_id=0
Open, In Progress, LowPublic

Description

According to https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CentralAuth/+/769847 on production we have some localuser rows with lu_local_id=0 or lu_global_id=0.

Event Timeline

Meh.

MariaDB [centralauth_p]> select * from localuser where lu_local_id=0;
+---------+------------------------------+-----------------------+--------------------+-------------+--------------+
| lu_wiki | lu_name                      | lu_attached_timestamp | lu_attached_method | lu_local_id | lu_global_id |
+---------+------------------------------+-----------------------+--------------------+-------------+--------------+
| arwiki  | Haaelsalama                  | 20160721063747        | new                |           0 |     47253103 |
| arwiki  | Hamo awad                    | 20160719143320        | new                |           0 |     47238617 |
| arwiki  | Hany sb                      | 20160720130326        | new                |           0 |     47246866 |
| arwiki  | Hollywood-Bollywood          | 20160715224935        | new                |           0 |     47209021 |
| arwiki  | Hussein Omer                 | 20160713184445        | new                |           0 |     47190598 |
| arwiki  | Jon Qq11Ww22                 | 20160717005916        | new                |           0 |     47216945 |
| arwiki  | Lara Al-Qarra                | 20160717052245        | new                |           0 |     47218023 |
| arwiki  | Mohamed mahyo                | 20160719180157        | new                |           0 |     47240197 |
| arwiki  | Mohammad swaid               | 20160719174859        | new                |           0 |     47240112 |
| arwiki  | Nevx vx                      | 20160719193629        | new                |           0 |     47240827 |
| arwiki  | Saeed AlZuhairi              | 20160717213026        | new                |           0 |     47223709 |
| arwiki  | Sedra janbai                 | 20160720233048        | new                |           0 |     47251115 |
| arwiki  | Shimaa gmal                  | 20160717204515        | new                |           0 |     47223468 |
| arwiki  | W2adam                       | 20160718144310        | new                |           0 |     47229771 |
| arwiki  | محمد نور المحمد              | 20160718145542        | new                |           0 |     47229875 |
| arwiki  | نور مراد                     | 20160717210828        | new                |           0 |     47223595 |
| azbwiki | Pınar. Shaker                | 20160717175145        | new                |           0 |     47222401 |
| azwiki  | İngilab                      | 20160714220738        | new                |           0 |     47200689 |
| bgwiki  | GoodGamerBG                  | 20160714104243        | new                |           0 |     47196028 |
| bgwiki  | MariaStoicheva               | 20160715184216        | new                |           0 |     47207651 |
| bgwiki  | Zaynmalik1914                | 20160715171659        | new                |           0 |     47207123 |
| bnwiki  | রকিবুল আলম                   | 20160716140616        | new                |           0 |     47213401 |
| bswiki  | Karasupici                   | 20160718212927        | new                |           0 |     47232599 |
+---------+------------------------------+-----------------------+--------------------+-------------+--------------+
23 rows in set (6 min 43.09 sec)

MariaDB [centralauth_p]>
taavi renamed this task from Fix localuser rows with lu_local_id=0 to Fix localuser rows with lu_local_id=0 or lu_global_id=0.Mar 14 2022, 11:28 AM
taavi updated the task description. (Show Details)

Change #1128018 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/CentralAuth@master] populateLocalAndGlobalIds.php: Fix rows with lu_local_id=0 or lu_global_id=0

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

Per T292473: Centralauth localuser table has entries with a null lu_global_id there are also some lingering null values for lu_global_id.

Those seem to have gone, maybe before, maybe a side effect of me running populateLocalAndGlobalIds.php for T388983: localuser rows where lu_global_id IS NOT NULL AND lu_local_id IS NULL not fixed by populateLocalAndGlobalIds.php

MariaDB [centralauth]> select count(*) from localuser where lu_local_id=0;
+----------+
| count(*) |
+----------+
|       19 |
+----------+
1 row in set (2 min 31.550 sec)

MariaDB [centralauth]> select count(*) from localuser where lu_global_id=0;
+----------+
| count(*) |
+----------+
|       23 |
+----------+
1 row in set (1 min 25.065 sec)

MariaDB [centralauth]> select count(*) from localuser where lu_global_id=null;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (1 min 31.441 sec)
Krinkle subscribed.

Issue is in scope and has a patch that needs review (alread listed on the team's Gerrit dashboard). Tagging here as well visibility.

Change #1128018 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] populateLocalAndGlobalIds.php: Fix rows with lu_local_id=0 or lu_global_id=0/null

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

Change #1130322 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/CentralAuth@REL1_43] populateLocalAndGlobalIds.php: Fix rows with lu_local_id=0 or lu_global_id=0/null

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

Change #1130322 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@REL1_43] populateLocalAndGlobalIds.php: Fix rows with lu_local_id=0 or lu_global_id=0/null

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

Reedy changed the task status from Open to In Progress.Mar 23 2025, 6:22 PM
Reedy triaged this task as Low priority.

Change #1130643 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/CentralAuth@wmf/1.44.0-wmf.21] populateLocalAndGlobalIds.php: Fix rows with lu_local_id=0 or lu_global_id=0/null

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

Change #1130643 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@wmf/1.44.0-wmf.21] populateLocalAndGlobalIds.php: Fix rows with lu_local_id=0 or lu_global_id=0/null

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

Mentioned in SAL (#wikimedia-operations) [2025-03-24T16:38:47Z] <reedy@deploy1003> Synchronized php-1.44.0-wmf.21/extensions/CentralAuth/maintenance/populateLocalAndGlobalIds.php: T303590 (duration: 11m 51s)

Well, this is fun... The number of lu_global_id=0 accounts has increased slightly in ~9 days...

MariaDB [centralauth]> select count(*) from localuser where lu_local_id=0;
+----------+
| count(*) |
+----------+
|       19 |
+----------+
1 row in set (6 min 2.328 sec)

MariaDB [centralauth]> select count(*) from localuser where lu_local_id=null;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (2 min 29.084 sec)

MariaDB [centralauth]> select count(*) from localuser where lu_global_id=0;
+----------+
| count(*) |
+----------+
|       27 |
+----------+
1 row in set (1 min 16.572 sec)

MariaDB [centralauth]> select count(*) from localuser where lu_global_id=null;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (1 min 21.253 sec)

MariaDB [centralauth]> SELECT count(*) FROM localuser WHERE lu_global_id IS NOT NULL AND lu_local_id IS NULL
    -> ;
+----------+
| count(*) |
+----------+
|      486 |
+----------+
1 row in set (1 min 19.639 sec)

Can we make a list of the affected recent accounts? I guess that would require looking at the dumps?

Posted an updated list on T388983: localuser rows where lu_global_id IS NOT NULL AND lu_local_id IS NULL not fixed by populateLocalAndGlobalIds.php for that specific case.. Could do an awkward diff between the two lists.

475 -> 486.

A couple have timestamps that start 2025...

I never actually did a dump of rows for lu_local_id=0 or lu_global_id=0, but as is, they are:

MariaDB [centralauth]> select * from localuser where lu_local_id=0 or lu_global_id=0;
+---------------+-----------------------------------------------+-----------------------+--------------------+-------------+--------------+----------------------+
| lu_wiki       | lu_name                                       | lu_attached_timestamp | lu_attached_method | lu_local_id | lu_global_id | lu_attachment_method |
+---------------+-----------------------------------------------+-----------------------+--------------------+-------------+--------------+----------------------+
| arwiki        | Asseriano                                     | 20150419012835        | primary            |      299420 |            0 |                 NULL |
| arwiki        | Hamo awad                                     | 20160719143320        | new                |           0 |     47238617 |                 NULL |
| arwiki        | Hany sb                                       | 20160720130326        | new                |           0 |     47246866 |                 NULL |
| arwiki        | Hollywood-Bollywood                           | 20160715224935        | new                |           0 |     47209021 |                 NULL |
| arwiki        | Jon Qq11Ww22                                  | 20160717005916        | new                |           0 |     47216945 |                 NULL |
| arwiki        | Lara Al-Qarra                                 | 20160717052245        | new                |           0 |     47218023 |                 NULL |
| arwiki        | Mohamed mahyo                                 | 20160719180157        | new                |           0 |     47240197 |                 NULL |
| arwiki        | Mohammad swaid                                | 20160719174859        | new                |           0 |     47240112 |                 NULL |
| arwiki        | Nevx vx                                       | 20160719193629        | new                |           0 |     47240827 |                 NULL |
| arwiki        | Sedra janbai                                  | 20160720233048        | new                |           0 |     47251115 |                 NULL |
| arwiki        | Shimaa gmal                                   | 20160717204515        | new                |           0 |     47223468 |                 NULL |
| arwiki        | W2adam                                        | 20160718144310        | new                |           0 |     47229771 |                 NULL |
| arwiki        | محمد نور المحمد                               | 20160718145542        | new                |           0 |     47229875 |                 NULL |
| arwiki        | نور مراد                                      | 20160717210828        | new                |           0 |     47223595 |                 NULL |
| azwiki        | İngilab                                       | 20160714220738        | new                |           0 |     47200689 |                 NULL |
| bgwiki        | GoodGamerBG                                   | 20160714104243        | new                |           0 |     47196028 |                 NULL |
| bgwiki        | MariaStoicheva                                | 20160715184216        | new                |           0 |     47207651 |                 NULL |
| bgwiki        | Zaynmalik1914                                 | 20160715171659        | new                |           0 |     47207123 |                 NULL |
| bnwiki        | রকিবুল আলম                                    | 20160716140616        | new                |           0 |     47213401 |                 NULL |
| bswiki        | Karasupici                                    | 20160718212927        | new                |           0 |     47232599 |                 NULL |
| cawiki        | OpenCapa8                                     | 20250303213356        | login              |      512143 |            0 |                 NULL |
| commonswiki   | Juniorzootec                                  | 20250117233827        | login              |    13528007 |            0 |                 NULL |
| commonswiki   | L72hrppm                                      | 20250311182442        | login              |    13652735 |            0 |                 NULL |
| commonswiki   | Mrzdexter                                     | 20250323080258        | login              |    13677172 |            0 |                 NULL |
| cswiki        | T̈ercasek                                     | 20221026055620        | admin              |       32772 |            0 |                 NULL |
| dewiki        | Mrzdexter                                     | 20250323080258        | login              |     4589521 |            0 |                 NULL |
| dewiki        | Renamed user af1413e2b4f442c6d1fbcb9a51cdcb49 | 20240919052606        | new                |     4474699 |            0 |                 NULL |
| enwiki        | ~Lj                                            | 20221026052801        | admin              |     8463245 |            0 |                 NULL |
| enwiki        | ~                                            | 20221026035545        | admin              |     8569079 |            0 |                 NULL |
| enwiki        | DZoo                                           | 20211104205856        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ԯ                                             | 20211104205107        | admin              |        NULL |            0 |                 NULL |
| enwiki        | ksplosɪv kæŋgəʃæn                            | 20211104205833        | admin              |        NULL |            0 |                 NULL |
| enwiki        |                                              | 20211104205534        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ʞɔ                                            | 20211104205510        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ʞɔ                                          | 20211104205443        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ʞɔnɥɔ                                         | 20211104205419        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ʞəʇɹɐq                                        | 20211104205400        | admin              |        NULL |            0 |                 NULL |
| enwiki        |                                              | 20211104205812        | admin              |        NULL |            0 |                 NULL |
| enwiki        | dɯoɹdɥsɐq                                    | 20211104205746        | admin              |        NULL |            0 |                 NULL |
| enwiki        |                                              | 20211104205625        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ʝɑɕƙ ʛɩƛɛȿƿɨɘ                                 | 20211104205559        | admin              |        NULL |            0 |                 NULL |
| incubatorwiki | Ⲫⲟⲩⲁⲙⲁⲣⲁⲃⲟⲥ                                   | 20211104204955        | admin              |        NULL |            0 |                 NULL |
| mediawikiwiki | Ⲫⲟⲩⲁⲙⲁⲣⲁⲃⲟⲥ                                   | 20211104204944        | admin              |        NULL |            0 |                 NULL |
| metawiki      | Ⲫⲟⲩⲁⲙⲁⲣⲁⲃⲟⲥ                                   | 20211104204856        | admin              |        NULL |            0 |                 NULL |
| metawiki      | dɯoɹdɥsɐq                                    | 20211104205720        | admin              |        NULL |            0 |                 NULL |
| metawiki      | sıdɐɹ ʇʇnq                                   | 20211104205706        | admin              |        NULL |            0 |                 NULL |
+---------------+-----------------------------------------------+-----------------------+--------------------+-------------+--------------+----------------------+
46 rows in set (3 min 9.500 sec)

At least one of the lu_global_id = 0 rows is specifically recently attached: 20250323080258

Post script run...

MariaDB [centralauth]> select * from localuser where lu_local_id=0 or lu_global_id=0;
+---------------+-----------------------------------+-----------------------+--------------------+-------------+--------------+----------------------+
| lu_wiki       | lu_name                           | lu_attached_timestamp | lu_attached_method | lu_local_id | lu_global_id | lu_attachment_method |
+---------------+-----------------------------------+-----------------------+--------------------+-------------+--------------+----------------------+
| enwiki        | DZoo                               | 20211104205856        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ԯ                                 | 20211104205107        | admin              |        NULL |            0 |                 NULL |
| enwiki        | ksplosɪv kæŋgəʃæn                | 20211104205833        | admin              |        NULL |            0 |                 NULL |
| enwiki        |                                  | 20211104205534        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ʞɔ                                | 20211104205510        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ʞɔ                              | 20211104205443        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ʞɔnɥɔ                             | 20211104205419        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ʞəʇɹɐq                            | 20211104205400        | admin              |        NULL |            0 |                 NULL |
| enwiki        |                                  | 20211104205812        | admin              |        NULL |            0 |                 NULL |
| enwiki        | dɯoɹdɥsɐq                        | 20211104205746        | admin              |        NULL |            0 |                 NULL |
| enwiki        |                                  | 20211104205625        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ʝɑɕƙ ʛɩƛɛȿƿɨɘ                     | 20211104205559        | admin              |        NULL |            0 |                 NULL |
| incubatorwiki | Ⲫⲟⲩⲁⲙⲁⲣⲁⲃⲟⲥ                       | 20211104204955        | admin              |        NULL |            0 |                 NULL |
| mediawikiwiki | Ⲫⲟⲩⲁⲙⲁⲣⲁⲃⲟⲥ                       | 20211104204944        | admin              |        NULL |            0 |                 NULL |
| metawiki      | Ⲫⲟⲩⲁⲙⲁⲣⲁⲃⲟⲥ                       | 20211104204856        | admin              |        NULL |            0 |                 NULL |
| metawiki      | dɯoɹdɥsɐq                        | 20211104205720        | admin              |        NULL |            0 |                 NULL |
| metawiki      | sıdɐɹ ʇʇnq                       | 20211104205706        | admin              |        NULL |            0 |                 NULL |
+---------------+-----------------------------------+-----------------------+--------------------+-------------+--------------+----------------------+
17 rows in set (6 min 40.763 sec)

Seems to have fixed nearly all of them, except those from a very specific timeframe...

More fun and games:

Error
labels.normalized_message
[{reqId}] {exception_url}   PHP Notice: Undefined index: YAIZD
FrameLocationCall
from/srv/mediawiki-staging/php-1.44.0-wmf.21/extensions/CentralAuth/maintenance/populateLocalAndGlobalIds.php(103)
#0/srv/mediawiki-staging/php-1.44.0-wmf.21/extensions/CentralAuth/maintenance/populateLocalAndGlobalIds.php(103)MWExceptionHandler::handleError(int, string, string, int, array)
#1/srv/mediawiki-staging/php-1.44.0-wmf.21/maintenance/includes/MaintenanceRunner.php(695)MediaWiki\Extension\CentralAuth\Maintenance\PopulateLocalAndGlobalIds->execute()
#2/srv/mediawiki-staging/php-1.44.0-wmf.21/maintenance/run.php(51)MediaWiki\Maintenance\MaintenanceRunner->run()
#3/srv/mediawiki-staging/multiversion/MWScript.php(219)require_once(string)
#4{main}
Impact
Notes

Change #1130695 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/CentralAuth@master] PopulateLocalAndGlobalIds: Don't set lu_local_id if we don't have a mapping...

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

Change #1130695 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] PopulateLocalAndGlobalIds: Don't set lu_local_id if we don't have a mapping...

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

Change #1130711 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/CentralAuth@REL1_43] PopulateLocalAndGlobalIds: Don't set lu_local_id if we don't have a mapping...

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

Change #1130712 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/CentralAuth@wmf/1.44.0-wmf.21] PopulateLocalAndGlobalIds: Don't set lu_local_id if we don't have a mapping...

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

Change #1130711 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@REL1_43] PopulateLocalAndGlobalIds: Don't set lu_local_id if we don't have a mapping...

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

Change #1130712 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@wmf/1.44.0-wmf.21] PopulateLocalAndGlobalIds: Don't set lu_local_id if we don't have a mapping...

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

Mentioned in SAL (#wikimedia-operations) [2025-03-24T22:04:54Z] <reedy@deploy1003> Synchronized php-1.44.0-wmf.21/extensions/CentralAuth/maintenance/populateLocalAndGlobalIds.php: T303590 (duration: 11m 56s)

wikiadmin2023@10.64.32.139(centralauth)> select * from localuser where lu_local_id=0 or lu_global_id=0;
+---------------+-----------------------------------+-----------------------+--------------------+-------------+--------------+----------------------+
| lu_wiki       | lu_name                           | lu_attached_timestamp | lu_attached_method | lu_local_id | lu_global_id | lu_attachment_method |
+---------------+-----------------------------------+-----------------------+--------------------+-------------+--------------+----------------------+
| alswiki       | R46 Foamer                        | 20240119174404        | login              |      102857 |            0 |                 NULL |
| arwiki        | Nahida (usurped)                  | 20150317085447        | primary            |      428008 |            0 |                 NULL |
| bewiki        | R46 Foamer                        | 20250130174855        | login              |      150454 |            0 |                 NULL |
| enwiki        | DZoo                               | 20211104205856        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ԯ                                 | 20211104205107        | admin              |        NULL |            0 |                 NULL |
| enwiki        | ksplosɪv kæŋgəʃæn                | 20211104205833        | admin              |        NULL |            0 |                 NULL |
| enwiki        |                                  | 20211104205534        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ʞɔ                                | 20211104205510        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ʞɔ                              | 20211104205443        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ʞɔnɥɔ                             | 20211104205419        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ʞəʇɹɐq                            | 20211104205400        | admin              |        NULL |            0 |                 NULL |
| enwiki        |                                  | 20211104205812        | admin              |        NULL |            0 |                 NULL |
| enwiki        | dɯoɹdɥsɐq                        | 20211104205746        | admin              |        NULL |            0 |                 NULL |
| enwiki        |                                  | 20211104205625        | admin              |        NULL |            0 |                 NULL |
| enwiki        | Ʝɑɕƙ ʛɩƛɛȿƿɨɘ                     | 20211104205559        | admin              |        NULL |            0 |                 NULL |
| incubatorwiki | Ⲫⲟⲩⲁⲙⲁⲣⲁⲃⲟⲥ                       | 20211104204955        | admin              |        NULL |            0 |                 NULL |
| mediawikiwiki | Ⲫⲟⲩⲁⲙⲁⲣⲁⲃⲟⲥ                       | 20211104204944        | admin              |        NULL |            0 |                 NULL |
| metawiki      | Ⲫⲟⲩⲁⲙⲁⲣⲁⲃⲟⲥ                       | 20211104204856        | admin              |        NULL |            0 |                 NULL |
| metawiki      | dɯoɹdɥsɐq                        | 20211104205720        | admin              |        NULL |            0 |                 NULL |
| metawiki      | sıdɐɹ ʇʇnq                       | 20211104205706        | admin              |        NULL |            0 |                 NULL |
+---------------+-----------------------------------+-----------------------+--------------------+-------------+--------------+----------------------+
20 rows in set (4 min 51.821 sec)
wikiadmin2023@10.64.32.139(centralauth)> select count(*) from localuser where lu_local_id=0; select count(*) from localuser where lu_local_id=null; select count(*) from localuser where lu_global_id=0; select count(*) from localuser where lu_global_id=null; SELECT count(*) FROM localuser WHERE lu_global_id IS NOT NULL AND lu_local_id IS NULL;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (1 min 26.762 sec)

+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (1 min 27.981 sec)

+----------+
| count(*) |
+----------+
|       20 |
+----------+
1 row in set (1 min 21.604 sec)

+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (1 min 26.920 sec)

+----------+
| count(*) |
+----------+
|     4909 |
+----------+
1 row in set (1 min 26.719 sec)

Well that last one has exploded...

Re-running the script does fix most of it up again..

wikiadmin2023@10.64.136.13(centralauth)> select count(*) from localuser where lu_local_id=0; select count(*) from localuser where lu_local_id=null; select count(*) from localuser where lu_global_id=0; select count(*) from localuser where lu_global_id=null; SELECT count(*) FROM localuser WHERE lu_global_id IS NOT NULL AND lu_local_id IS NULL;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (2 min 38.647 sec)

+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (50.146 sec)

+----------+
| count(*) |
+----------+
|       17 |
+----------+
1 row in set (44.249 sec)

+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (47.835 sec)

+----------+
| count(*) |
+----------+
|      246 |
+----------+
1 row in set (45.997 sec)

wikiadmin2023@10.64.136.13(centralauth)>

After another script run...

wikiadmin2023@10.192.32.98(centralauth)> select count(*) from localuser where lu_local_id=0; select count(*) from localuser where lu_local_id=null; select count(*) from localuser where lu_global_id=0; select count(*) from localuser where lu_global_id=null; SELECT count(*) FROM localuser WHERE lu_global_id IS NOT NULL AND lu_local_id IS NULL;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (2 min 24.338 sec)

+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (50.817 sec)

+----------+
| count(*) |
+----------+
|       17 |
+----------+
1 row in set (42.318 sec)

+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (49.024 sec)

+----------+
| count(*) |
+----------+
|      129 |
+----------+

Movement in the right direction on the last query...

Of course...

wikiadmin2023@10.192.32.98(centralauth)> select count(*) from localuser where lu_local_id is null; select count(*) from localuser where lu_global_id is null;
+----------+
| count(*) |
+----------+
|     4042 |
+----------+
1 row in set (44.294 sec)

+----------+
| count(*) |
+----------+
|     3913 |
+----------+
1 row in set (41.767 sec)

Change #1211821 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/CentralAuth@master] PopulateLocalAndGlobalIds: Query for users where lu_local_id or lu_global_id IS null

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

Change #1211821 abandoned by Reedy:

[mediawiki/extensions/CentralAuth@master] PopulateLocalAndGlobalIds: Query for users where lu_local_id or lu_global_id IS null

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

Change #1211847 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/CentralAuth@master] PopulateLocalAndGlobalIds: Make a better attempt to populate lu_local_id

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

After running that latest script PS... That has cleared up 3526 rows where lu_local_id is null

wikiadmin2023@10.192.48.205(centralauth)> select count(*) from localuser where lu_local_id is null; select count(*) from localuser where lu_global_id is null;
+----------+
| count(*) |
+----------+
|      516 |
+----------+
1 row in set (49.696 sec)

+----------+
| count(*) |
+----------+
|     3913 |
+----------+
1 row in set (42.032 sec)

A week later, it's not got any worse...

wikiadmin2023@10.192.32.98(centralauth)> select count(*) from localuser where lu_local_id is null; select count(*) from localuser where lu_global_id is null;
+----------+
| count(*) |
+----------+
|      516 |
+----------+
1 row in set (43.619 sec)

+----------+
| count(*) |
+----------+
|     3913 |
+----------+
1 row in set (41.663 sec)