Page MenuHomePhabricator

Special:Contributions: "contributions page filtered for namespace or RevisionDeleted edits" error
Closed, ResolvedPublic

Description

Was trying to find out if ClueBot NG has ever made any edits in the File: namespace. But going to https://en.wikipedia.org/w/index.php?limit=50&tagfilter=&title=Special%3AContributions&contribs=user&target=ClueBot+NG&namespace=6&tagfilter=&year=2015&month=-1 gives

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

Function: IndexPager::buildQueryInfo (contributions page filtered for namespace or RevisionDeleted edits)
Error: 2013 Lost connection to MySQL server during query (10.64.32.25)

Event Timeline

Nakon raised the priority of this task from to Needs Triage.
Nakon updated the task description. (Show Details)
Nakon subscribed.

Cluebot NG has a lot of edits (~3.5 million) and almost all of them will be in main space. Also, running this exact query on other users works fine, although it does take a long time. Is this just a timeout because the query is taking so long for users with high edit counts?

This query is checking namespace 6

This query is checking namespace 6

Indeed, and that's kind of my point. If the query trying to find the fifty most recent edits in that namespace belonging to that user, then it may essentially have to check every edit, in order, to see if it's in that namespace. That normally wouldn't be a massive problem, but MediaWiki wasn't really designed under the assumption that one user might get 3.5 million edits!

This comment was removed by Nakon.

Removed my previous comment as it was incorrect. I would expect, however, that mediawiki gracefully reject the request rather than die with a db error

MariaDB [enwiki_p]> select count(*) from revision_userindex left join page on page_id = rev_page where page_namespace = 6 and rev_user_text = 'ClueBot NG';
+----------+

count(*)
0

+----------+
1 row in set (5 min 59.50 sec)

Given the sheer scope of the database query I am not sure that its possible to be effective on WMF wikis.

Setting priority to reflect that this seems to be a relatively well-contained issue that does not affect site stability significantly.

Removed my previous comment as it was incorrect. I would expect, however, that mediawiki gracefully reject the request rather than die with a db error

I would agree that it should, but often it's hard to know that something's going to take a long time before you run it. One can apply some kind of heuristic such as "if the user has over ARBITRARY_NUMBER_OF_EDITS then don't run the query". Something like this could be added here.

Glaisher renamed this task from Special:Contributions database error to Special:Contributions: "contributions page filtered for namespace or RevisionDeleted edits" error.Sep 4 2015, 3:26 PM
Glaisher set Security to None.
Glaisher added subscribers: Matanya, Steinsplitter.
Glaisher subscribed.

https://commons.wikimedia.org/w/index.php?title=Special:Contributions&offset=20160429033856&contribs=user&target=Jarekt&namespace=828&tagfilter= will give the same error:

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

Function: IndexPager::buildQueryInfo (contributions page filtered for namespace or RevisionDeleted edits)
Error: 2013 Lost connection to MySQL server during query (10.64.16.8)

@Multichill I think in your case it was a 1 in a million error, I cannot reproduce (it can also happen if database is cold for contributions on a user- reloading the page will solve it).

The general issue is that there is literally (this is exact, we counted them) 2 million different queries that can be done for recentchanges (that doesn't mean 2 million different users or namespaces, those are not counted here, it means 2 million different parameters/options/checkboxes that can be combined to create a query). We optimize with indexes for the most usual ones, but it is very difficult to optimize in absolutely all cases/combinations- specially for edge cases where a user has many edits.

I think the current state, while not optimal, is better than trying to limit the query options. I think Deskana suggestion is ok, maybe capture the error and try to be more informative. New optimizations are applied constantly, but I hope this clarifies why this is not easy to fix.

Marostegui subscribed.

I am going to consider this resolved. As Jaime said, it might have been a random error.
I have tried several times the original URL plus the one in T108782#2398537 and they have worked every single time

Feel free to reopen if you think it is necessary!
Thanks for the report.