Page MenuHomePhabricator

A huge spike on read rows for commonswiki
Closed, ResolvedPublic

Description

We had a huge spike on commonswiki after running the train of 1.33.0-wmf.8
The query is the following:

SELECT /* ApiPageSet::initFromPageIds */ page_namespace, page_title, page_id, page_content_model, page_lang, page_len, page_is_redirect, page_latest FROM `page` WHERE page_id IN ('-1', '-2') /* 8ac75033ec8e7474569731213f57d591 db1084 commonswiki 32s */

The explain is for:

+------+-------------+-------+------+---------------+------+---------+------+----------+-------------+
| id   | select_type | table | type | possible_keys | key  | key_len | ref  | rows     | Extra       |
+------+-------------+-------+------+---------------+------+---------+------+----------+-------------+
|    1 | SIMPLE      | page  | ALL  | PRIMARY       | NULL | NULL    | NULL | 67236817 | Using where |
+------+-------------+-------+------+---------------+------+---------+------+----------+-------------+

Event Timeline

Banyek created this task.Dec 12 2018, 6:22 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 12 2018, 6:22 PM

Change 479257 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] ApiPageSet::initFromPageIds: Default $filterIds to true

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

zeljkofilipin triaged this task as Unbreak Now! priority.Dec 12 2018, 6:24 PM
zeljkofilipin added subscribers: Joe, zeljkofilipin.

I've added it to train blockers as suggested by @Joe in #wikimedia-operations and raised priority to UBN (since all train blockers have that priority).

Restricted Application added subscribers: Liuxinyu970226, TerraCodes. · View Herald TranscriptDec 12 2018, 6:24 PM
Anomie added a subscriber: Anomie.Dec 12 2018, 6:26 PM

All in all, I don't think there's really a reason to block the train for this any more than we should have been blocking every train since 2016 for T140302, which is the same issue except with very large positive numbers instead of negative ones. But, if someone wants to merge that patch, it'll stop the API from making similar queries in the future for this code path.

greg lowered the priority of this task from Unbreak Now! to High.Dec 12 2018, 6:28 PM
greg added a subscriber: greg.

Per @Anomie.

Thanks @Anomie!
Let's get it merged, yes, please!

Banyek moved this task from Triage to In progress on the DBA board.Dec 12 2018, 9:29 PM

+2'd, I leave it to our DBAs if they think this needs to be backported or we should wait until wmf.9. If you think this needs backport, I can take care of it.

+2'd, I leave it to our DBAs if they think this needs to be backported or we should wait until wmf.9. If you think this needs backport, I can take care of it.

Let's backport it to be on the safe side if you can! :-)

Change 479257 merged by jenkins-bot:
[mediawiki/core@master] ApiPageSet::initFromPageIds: Default $filterIds to true

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

Change 479428 had a related patch set uploaded (by Ladsgroup; owner: Anomie):
[mediawiki/core@wmf/1.33.0-wmf.8] ApiPageSet::initFromPageIds: Default $filterIds to true

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

Change 479428 merged by jenkins-bot:
[mediawiki/core@wmf/1.33.0-wmf.8] ApiPageSet::initFromPageIds: Default $filterIds to true

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

Mentioned in SAL (#wikimedia-operations) [2018-12-13T15:12:43Z] <anomie@deploy1001> Synchronized php-1.33.0-wmf.8/includes/api/ApiPageSet.php: Backport fix for T211804: ApiPageSet::initFromPageIds: Default $filterIds to true (duration: 00m 46s)

Anomie closed this task as Resolved.Dec 13 2018, 3:13 PM
Anomie claimed this task.

Worked around and backported