Page MenuHomePhabricator

Database deadlock on page table page_counter after import
Closed, DeclinedPublic

Description

I did an XML import on our wiki, containing about 40 articles. It reported 39 of the imports on Special:RecentChanges but not the 40th, and the import page hung.

When I hit the 40th page directly, I got;

Database error
A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
UPDATE vpw_page SET page_counter = page_counter + 1 WHERE page_id = 20392
from within function "". MySQL returned error "1205: Lock wait timeout exceeded; try restarting transaction (localhost)".

or:

The last attempted database query was:
UPDATE vpw_page SET page_touched = '20090306210413' WHERE page_namespace = '0' AND page_title = 'My_page_title_whatever'
from within function "Title::invalidateCache". MySQL returned error "1205: Lock wait timeout exceeded; try restarting transaction (localhost)".

This situation has lasted now for 30 minutes straight.

Other wiki pages are unaffected, just this one.

I viewed the entries for this article in the page table (page_id=20392), revision table, and text table. They are consistent. The import (which would have modified the page) did not succeed -- the old page text is present.

I can view the History and Edit pages with problem. Only the actual article cannot be viewed.

I ran "show innodb status" and it showed the following deadlock information:


LATEST DETECTED DEADLOCK

090305 22:26:04

  • (1) TRANSACTION:

TRANSACTION 0 41477638, ACTIVE 1 sec, process no 2239, OS thread id 1186842944 inserting
mysql tables in use 1, locked 1
LOCK WAIT 4 lock struct(s), heap size 1216
MySQL thread id 99508, query id 1859443 localhost wikiuser update
INSERT /* MediaWikiBagOStuff::_doinsert 10.95.201.34 */ IGNORE INTO vpw_objectcache (keyname,value,exptime) VALUES ('wikidb-vpw_:pcache:idhash:21029-0!1!0!!en!2!edit=0','lots of binary data here...'


Version: 1.14.x
Severity: major
OS: Linux

Details

Reference
bz17819

Related Objects

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:35 PM
bzimport set Reference to bz17819.
bzimport added a subscriber: Unknown Object (MLST).

Other facts:

The import never finished. It hung for several minutes and then I closed the browser window.

Restarting apache cleared up the problem. Maybe the import process was still holding a lock via some httpd process.

sumanah wrote:

Dan, sorry it took so long to reply to you. If you still happen to have the old pages lying around so we could test the XML import on MediaWiki 1.17.0 (or, better yet, trunk), we could check whether this bug might still affect people, or whether it's already been fixed.

Thanks!

Sorry, I do not have the old import file anymore.

I'm afraid that without an available testcase to reproduce, there's not much that can be investigated anymore nowadays, unfortunately. :(