Page MenuHomePhabricator

maintenance/deleteRevision.php on last revision breaks targeted page
Closed, ResolvedPublic

Description

Author: nat

Description:
maintenance/deleteRevision.php, when used on the last revision of a page, 'breaks' it: trying to access to it leads to an error message ("database cannot find article contents").

Cause: maintenance/deleteRevision.php or an underlying function fails to maintain the page_latest column.


Manual fix after such an incident:

('TITLE' is the article title):
select rev_id,rev_user_text,rev_timestamp,left(rev_comment,60) from page,revision where rev_page=page_id and page_title='TITLE' order by rev_id desc limit 1

Check, using the page history, that the revision is the topmost one

Then:
('X' is the rev_id):

update page set page_latest=X where namespace=0 and page_id=;

Note: my MW instance animates a wiki farm, therefore at deleteRevision.php invocation time a symlink is tied from the adequate file to 'AdminSettings.php' and the '--conf=' argument is provided along with the adequate filename.

Thx for the great work on MW


Version: 1.16.x
Severity: normal

Details

Reference
bz19857

Event Timeline

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

Reverted in r55457 -- unindexed query would cause full scan on page table.