A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://phabricator.wikimedia.org/T299104 below:

⚓ T299104 Prepare script to update invalid user preferences after skins have been separated

I'm not sure I have the queries correct but if I do, the number of affected rows is only 37 for enwiki -- these are users who have skin = "vector" and VectorSkinVersion = "2" in the user_properties table.

The schema for user_properties looks like this:

[enwiki]> SHOW COLUMNS FROM user_properties;
+-------------+------------------+------+-----+---------+-------+
| Field       | Type             | Null | Key | Default | Extra |
+-------------+------------------+------+-----+---------+-------+
| up_user     | int(10) unsigned | NO   | PRI | NULL    |       |
| up_property | varbinary(255)   | NO   | PRI |         |       |
| up_value    | blob             | YES  |     | NULL    |       |
+-------------+------------------+------+-----+---------+-------+
3 rows in set (0.002 sec)

I queried the analytics replica from stat1006 using the following:

[enwiki]> SELECT COUNT(DISTINCT(up_user)) FROM user_properties WHERE (up_property="VectorSkinVersion" AND up_value="2") AND up_user IN (SELECT up_user FROM user_properties WHERE up_property="skin" AND up_value="vector");
+--------------------------+
| COUNT(DISTINCT(up_user)) |
+--------------------------+
|                       37 |
+--------------------------+
1 row in set (8.035 sec)

The same query without the count returned 37 rows of user ids:

[enwiki]> SELECT DISTINCT(up_user) FROM user_properties WHERE (up_property="VectorSkinVersion" AND up_value="2") AND up_user IN (SELECT up_user FROM user_properties WHERE up_property="skin" AND up_value="vector");

Running the queries independently returns significantly more rows:

[enwiki]> SELECT COUNT(DISTINCT(up_user)) FROM user_properties WHERE up_property="skin" AND up_value="vector";
+--------------------------+
| COUNT(DISTINCT(up_user)) |
+--------------------------+
|                   161182 |
+--------------------------+
1 row in set (56.760 sec)

and

[enwiki]> SELECT COUNT(DISTINCT(up_user)) FROM user_properties WHERE up_property="VectorSkinVersion" AND up_value="2";
+--------------------------+
| COUNT(DISTINCT(up_user)) |
+--------------------------+
|                    16806 |
+--------------------------+
1 row in set (9.638 sec)

For kicks, I ran the same query on a few other pilot wikis - here's frwiki:

[frwiki]> SELECT COUNT(DISTINCT(up_user)) FROM user_properties WHERE (up_property="VectorSkinVersion" AND up_value="2") AND up_user IN (SELECT up_user FROM user_properties WHERE up_property="skin" AND up_value="vector");
+--------------------------+
| COUNT(DISTINCT(up_user)) |
+--------------------------+
|                       11 |
+--------------------------+
1 row in set (7.320 sec)

hewiki:

[hewiki]> SELECT COUNT(DISTINCT(up_user)) FROM user_properties WHERE (up_property="VectorSkinVersion" AND up_value="2") AND up_user IN (SELECT up_user FROM user_properties WHERE up_property="skin" AND up_value="vector");
+--------------------------+
| COUNT(DISTINCT(up_user)) |
+--------------------------+
|                       23 |
+--------------------------+
1 row in set (0.806 sec)

mediawikiwiki:

[mediawikiwiki]> SELECT COUNT(DISTINCT(up_user)) FROM user_properties WHERE (up_property="VectorSkinVersion" AND up_value="2") AND up_user IN (SELECT up_user FROM user_properties WHERE up_property="skin" AND up_value="vector");
+--------------------------+
| COUNT(DISTINCT(up_user)) |
+--------------------------+
|                       11 |
+--------------------------+
1 row in set (1.903 sec)

dewiki (not part of desktop-improvements but still had some qualifying user accounts):

[dewiki]> SELECT COUNT(DISTINCT(up_user)) FROM user_properties WHERE (up_property="VectorSkinVersion" AND up_value="2") AND up_user IN (SELECT up_user FROM user_properties WHERE up_property="skin" AND up_value="vector");
+--------------------------+
| COUNT(DISTINCT(up_user)) |
+--------------------------+
|                        5 |
+--------------------------+
1 row in set (1.594 sec)

So to answer the questions in the ticket description:

How many rows are impacted? (run a query a week after change)

If my queries are correct, it looks like only 37 users on enwiki (and to a lesser extent, some users on other pilot wikis) are affected.

Should we write a script to migrate these rows, or simply revert these users back to legacy Vector for manual correction?

If my queries are correct and it's truly only 37 users on enwiki (and even less on pilot wikis), it seems like we should just revert these users to legacy Vector manually?

Nevertheless I'm happy to write a script for the exercise of doing so and documenting the process.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4