Page MenuHomePhabricator

Discrepancy between labsdb replicas of arwiki_p.user_groups
Closed, InvalidPublic

Description

There are a problem when running a code on tool-labs. There is a code written for getting stats of sysops activities, but this code, which run on tool-labs, doesn't give the right results.

for example, In Arabic wikipedia there are 35 sysops, but when running the code, it recognize only 34 sysop, which mean there is a user that not in the list. In the past, there are another sysop that also not in the list, but she was resigned. The only thing that connect between the two users is that they get the sysop's rights in the same day!.

On the other hand, when I run the query used in the code on Quarry, it give the exact results. http://quarry.wmflabs.org/query/9171

Here is the code: https://ar.wikipedia.org/w/index.php?title=user:Elph/adminstat&oldid=19414118

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

The same query on arwiki.labsdb:

MariaDB [arwiki_p]>         SELECT
    ->         user_name,
    ->         COUNT(log_timestamp)
    ->         FROM logging
    ->         JOIN user
    ->         ON user_id = log_user
    ->         WHERE log_type = 'delete'
    ->         AND log_action = 'delete'
    ->         AND user_name IN (SELECT user_name FROM user_groups INNER JOIN user ON user_id = ug_user WHERE ug_group = 'sys
op')
    ->         GROUP BY log_user;
+---------------------------------------+----------------------+
| user_name                             | COUNT(log_timestamp) |
+---------------------------------------+----------------------+
| Abanima                               |                11354 |
| Mido                                  |                 1567 |
| Ali1                                  |                14395 |
| Meno25                                |                42772 |
| Freedom's Falcon                      |                 3511 |
| Mohamed Ouda                          |                 8861 |
| محمد أحمد عبد الفتاح                  |                 7682 |
| OsamaK                                |                 9167 |
| وهراني                                |                 1275 |
| Muhends                               |                 5567 |
| زكريا                                 |                 2592 |
| باسم                                  |                36642 |
| DrFO.Tn                               |                 1946 |
| Riadismet                             |                 7222 |
| Elmoro                                |                 4074 |
| Trabelsiismail                        |                 2339 |
| عمرو بن كلثوم                         |                 4545 |
| شرف الدين                             |                11783 |
| Antime                                |                 5076 |
| Ravan                                 |                  469 |
| Ibrahim.ID                            |                 6577 |
| بدارين                                |                 3049 |
| Helmoony                              |                 4378 |
| Ziad                                  |                 2677 |

| Avocato                               |                96093 |
| Faris knight                          |                 2772 |
| Mohatatou                             |                   37 |
| Elph                                  |                91884 |
| لا روسا                               |                 4178 |
| سامي الرحيلي                          |                20358 |
| Mervat Salman                         |                 4198 |
| أسامة الساعدي                         |                 1393 |
| مصعب                                  |                 3996 |
+---------------------------------------+----------------------+
34 rows in set (24.20 sec)

Possibly the same issue as T115517: Data missing from June 11/12 on s3.labsdb?

On labsdb1001 I get 35 rows from that query (SELECT user_name, COUNT(log_timestamp) FROM logging JOIN user ON user_id = log_user WHERE log_type = 'delete' AND log_action = 'delete' AND user_name IN (SELECT user_name FROM user_groups INNER JOIN user ON user_id = ug_user WHERE ug_group = 'sysop') GROUP BY log_user;), but on labsdb1003 I get 34 rows.

krenair@tools-bastion-03:~$ echo "SELECT user_name, COUNT(log_timestamp) FROM logging JOIN user ON user_id = log_user WHERE log_type = 'delete' AND log_action = 'delete' AND user_name IN (SELECT user_name FROM user_groups INNER JOIN user ON user_id = ug_user WHERE ug_group = 'sysop') GROUP BY log_user;" | mysql --defaults-file=replica.my.cnf -h labsdb1001.eqiad.wmnet arwiki_p | wc -l
36
krenair@tools-bastion-03:~$ echo "SELECT user_name, COUNT(log_timestamp) FROM logging JOIN user ON user_id = log_user WHERE log_type = 'delete' AND log_action = 'delete' AND user_name IN (SELECT user_name FROM user_groups INNER JOIN user ON user_id = ug_user WHERE ug_group = 'sysop') GROUP BY log_user;" | mysql --defaults-file=replica.my.cnf -h labsdb1003.eqiad.wmnet arwiki_p | wc -l
35

Quarry always uses labsdb1001 IIRC, whereas your code is most likely using labsdb1003:

krenair@tools-bastion-03:~$ host arwiki.labsdb
arwiki.labsdb has address 10.64.37.5
krenair@tools-bastion-03:~$ host 10.64.37.5
5.37.64.10.in-addr.arpa domain name pointer labsdb1003.eqiad.wmnet.
Krenair renamed this task from Discrepancy between quarry results, and toolabs. to Discrepancy between labsdb replicas of arwiki_p.user_groups.Apr 23 2016, 8:39 PM

specifically the row with ug_user=396026 and ug_group=sysop is missing on labsdb1003

It's the same issue as T115517: Data missing from June 11/12 on s3.labsdb. Both users get the sysop's rights in June 12 at 04:25 am.

jcrespo subscribed.

This may have been true at some point, but I do not see this difference with the given query- labsdb1001 and labsdb1003 are identical, and all of them to the production master. I get 34 rows in all cases. Either this was fixed at some point or it was a temporary desync.