Last modified: 2012-09-03 13:47:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T40451, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38451 - Kill $wgAllowPageInfo; enable MediaWiki's info action by default
Kill $wgAllowPageInfo; enable MediaWiki's info action by default
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on: 39490
Blocks: 38450 16362
  Show dependency treegraph
 
Reported: 2012-07-17 20:35 UTC by MZMcBride
Modified: 2012-09-03 13:47 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description MZMcBride 2012-07-17 20:35:19 UTC
As documented at <https://www.mediawiki.org/wiki/Requests_for_comment/Reimplement_info_action>, the info action in MediaWiki was disabled by Tim in r4247 by putting it behind the global variable $wgAllowPageInfo and setting this global to false by default.

Now with years of hindsight, it's become clear that a more generic solution should have been used (e.g., $wgDisabledActions), however this bug is about killing (or deprecating) $wgAllowPageInfo and enabling action=info by default.

This requires marking the global as unused in DefaultSettings.php, removing the conditional code that relies on this global variable (fortunately it's not used in many places), and then disabling the expensive portions of the info action that caused the action to be flatly disabled so many years ago (namely disabling any properties that rely on unoptimized queries).

Relying on $wgMiserMode is one option. Another option is to introduce an array such as $wgDisabledInfoActionProperties or introduce another binary global such as $wgDisableExpensiveInfoActionProperties, though I'm very hesitant to add a binary global variable again.
Comment 1 Sam Reed (reedy) 2012-07-17 21:18:00 UTC
We can MiserMode and call $dbw->estimateRowCount on the bad queries... ;)

The only really slow query is the distinct revision count, but even then this isn't too bad.

page_counter is useless for WMF usage... And is half based on $wgDisableCounters

https://gerrit.wikimedia.org/r/#/c/15840/
https://gerrit.wikimedia.org/r/#/c/15844/


mysql> explain select count(*) from watchlist where wl_title = 'Barack_Obama' AND wl_namespace = '0';
+----+-------------+-----------+------+-----------------+-----------------+---------+-------------+------+--------------------------+
| id | select_type | table     | type | possible_keys   | key             | key_len | ref         | rows | Extra                    |
+----+-------------+-----------+------+-----------------+-----------------+---------+-------------+------+--------------------------+
|  1 | SIMPLE      | watchlist | ref  | namespace_title | namespace_title | 261     | const,const | 4060 | Using where; Using index |
+----+-------------+-----------+------+-----------------+-----------------+---------+-------------+------+--------------------------+
1 row in set (0.00 sec)

mysql> select count(*) from watchlist where wl_title = 'Barack_Obama' AND wl_namespace = '0';
+----------+
| count(*) |
+----------+
|     2234 |
+----------+
1 row in set (0.00 sec)

mysql> select count(*) from watchlist where wl_namespace = '0' AND wl_title = 'Barack_Obama';
+----------+
| count(*) |
+----------+
|     2234 |
+----------+
1 row in set (0.00 sec)

mysql> select * from page where page_namespace = 0 and page_title = 'Barack_Obama';
+---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+
| page_id | page_namespace | page_title   | page_restrictions | page_counter | page_is_redirect | page_is_new | page_random    | page_touched   | page_latest | page_len |
+---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+
|  534366 |              0 | Barack_Obama |                   |            0 |                0 |           0 | 0.379391504628 | 20120717194453 |   502845086 |   203903 |
+---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+
1 row in set (0.00 sec)

mysql> explain select count(rev_page) from revision where rev_page = 534366;
+----+-------------+----------+------+------------------------+----------------+---------+-------+-------+-------------+
| id | select_type | table    | type | possible_keys          | key            | key_len | ref   | rows  | Extra       |
+----+-------------+----------+------+------------------------+----------------+---------+-------+-------+-------------+
|  1 | SIMPLE      | revision | ref  | PRIMARY,page_timestamp | page_timestamp | 4       | const | 17160 | Using index |
+----+-------------+----------+------+------------------------+----------------+---------+-------+-------+-------------+
1 row in set (0.00 sec)

mysql> select count(rev_page) from revision where rev_page = 534366;
+-----------------+
| count(rev_page) |
+-----------------+
|           22257 |
+-----------------+
1 row in set (0.01 sec)

mysql> explain select COUNT(DISTINCT rev_user_text) from revision where rev_page = 534366;
+----+-------------+----------+-------+------------------------+---------+---------+------+-------+-------------+
| id | select_type | table    | type  | possible_keys          | key     | key_len | ref  | rows  | Extra       |
+----+-------------+----------+-------+------------------------+---------+---------+------+-------+-------------+
|  1 | SIMPLE      | revision | range | PRIMARY,page_timestamp | PRIMARY | 4       | NULL | 38318 | Using where |
+----+-------------+----------+-------+------------------------+---------+---------+------+-------+-------------+
1 row in set (0.02 sec)

mysql> select COUNT(DISTINCT rev_user_text) from revision where rev_page = 534366;
+-------------------------------+
| COUNT(DISTINCT rev_user_text) |
+-------------------------------+
|                          5923 |
+-------------------------------+
1 row in set (1.03 sec)

mysql> select page_counter from revision where rev_page = 534366;
ERROR 1054 (42S22): Unknown column 'page_counter' in 'field list'
mysql> select page_counter from page where page_id = 534366;
+--------------+
| page_counter |
+--------------+
|            0 |
+--------------+
1 row in set (0.00 sec)

mysql> select * from page where page_id = 534366;
+---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+
| page_id | page_namespace | page_title   | page_restrictions | page_counter | page_is_redirect | page_is_new | page_random    | page_touched   | page_latest | page_len |
+---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+
|  534366 |              0 | Barack_Obama |                   |            0 |                0 |           0 | 0.379391504628 | 20120717194453 |   502845086 |   203903 |
+---------+----------------+--------------+-------------------+--------------+------------------+-------------+----------------+----------------+-------------+----------+
1 row in set (0.00 sec)
Comment 2 Sam Reed (reedy) 2012-07-21 22:01:13 UTC
https://gerrit.wikimedia.org/r/#/c/16235/ does the actual killing of the global
Comment 3 Antoine "hashar" Musso (WMF) 2012-09-03 08:59:48 UTC
Updated manual at https://www.mediawiki.org/w/index.php?title=Manual:$wgAllowPageInfo&diff=579349&oldid=562830 to mention the setting has been removed with 1.20.
Comment 4 Sam Reed (reedy) 2012-09-03 13:47:20 UTC
16235 is merged

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links