Page MenuHomePhabricator

[[Special:Random/Education Program]] throws a database error
Closed, ResolvedPublic

Description

[[Special:Random/Education Program]] gives this:


A database query error has occurred. This may indicate a bug in the software.

Function: RandomPage::selectRandomPageFromDB
Error: 0

Not sure if this is a bug in the EducationProgram extension or in MediaWiki core code.


Version: 1.23.0
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=58157
https://bugzilla.wikimedia.org/show_bug.cgi?id=57285

Details

Reference
bz58324

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:42 AM
bzimport set Reference to bz58324.
bzimport added a subscriber: Unknown Object (MLST).

The following lines show up in dberrors.log when I try loading that page:

Wed Dec 11 14:12:41 UTC 2013 mw1112 enwiki Connection lost and reconnected after 99.509s, query: SELECT /* RandomPage::selectRandomPageFromDB */ page_title,page_namespace FROM page FORCE INDEX (page_random) WHERE page_namespace = '446' AND page_is_redirect = '0' AND (page_random >= 0) ORDER BY page_random LIMIT 1
Wed Dec 11 14:12:41 UTC 2013 mw1112 enwiki RandomPage::selectRandomPageFromDB 10.64.32.22 0 SELECT page_title,page_namespace FROM page FORCE INDEX (page_random) WHERE page_namespace = '446' AND page_is_redirect = '0' AND (page_random >= 0) ORDER BY page_random LIMIT 1

A quick check in the database finds zero rows for SELECT * FROM page WHERE page_namespace = '446' on enwiki.

Hmm, the FORCE INDEX looks inappropriate there.

I talked with Andrew Green about this a little bit yesterday. From a user perspective, it's not very important to have Special:Random work for the Education Program namespace, but I suggested to Andrew to simply catch this situation and display a message to the effect that Special:Random is not available for that namespace.

It looks like there are two issues here:

  1. Special:Random doesn't handle empty namespaces (or almost-empty namespaces, I'd guess) well when there are a very large number of pages in other namespaces.
  1. EducationProgram doesn't work with Special:Random (or Special:AllPages, or probably various other bits of MediaWiki), because it doesn't use the page table at all.

I'd suggest splitting the second problem to a new bug.

Spotted this in bug 57285 via slow query logs. Same conclusion: the forced index is no longer appropriate.

Error is now impossible, because a message is shown:

Random article
There are no pages in the following namespace: Education_Program.