Last modified: 2013-11-06 05:20:35 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T55687, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 53687 - LinksDeletionUpdate skipped, causing revisions to disappear on undelete
LinksDeletionUpdate skipped, causing revisions to disappear on undelete
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: High critical (vote)
: ---
Assigned To: Tim Starling
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-02 20:12 UTC by Trijnstel
Modified: 2013-11-06 05:20 UTC (History)
10 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Binlog excerpt (deleted)
2013-10-01 01:35 UTC, Tim Starling
Details

Description Trijnstel 2013-09-02 20:12:11 UTC
See https://nl.wikipedia.org/wiki/Speciaal:Terugplaatsen/Robert_Hardeman
-----
Deletion log
    (show/hide) 15:31, 1 September 2013 Kattenkruid (Talk | contribs | block) deleted page Robert Hardeman (dit gaat niet goed) (view/restore)
    (show/hide) 22:31, 31 August 2013 Kattenkruid (Talk | contribs | block) deleted page Robert Hardeman (Geklieder of ander vandalisme: De inhoud was: "Robert ook steunt Robert de jacht op dolfijnen want die hebben het dol fijn in de zee en smaken lekker net als kip!!, zelf is hij ook een grote Fan van ..." ([[Special:Contrib...) (view/restore)

Suppression log
No matching items in log.

Page history
There is no edit history for this page. 
-----
The page wasn't restored and renamed. It was deleted two times (why? went the deletion wrong?) and the deleted edits suddenly disappeared. The edit, however, is still visible in the recent changes as it seems and can't be marked.

Can someone look at this and maybe fix it so that the items are visible again?
Comment 1 Nemo 2013-09-02 20:18:23 UTC
Most likely WMW issue; data loss -> critical.
Comment 2 Bawolff (Brian Wolff) 2013-09-19 15:34:37 UTC
Why was this moved to media storage. Page is not an image (?)
Comment 3 Andre Klapper 2013-09-20 13:23:00 UTC
Oops, sorry, my fault.
Comment 4 Tim Starling 2013-10-01 01:32:21 UTC
The binlogs show:

* The article was created by an anonymous user at 2013-08-31 20:30:09
* The article was edited by Ronn at 20:31:00, apparently tagging it for deletion
* Later in the same second (20:31:00), the article was deleted by Kattenkruid

The deletion action went awry. The revisions were copied into the archive table, but they were never deleted from the revision table. The most likely reason for this appears to be a failure of WikiPage::getContent(). The binlog shows WikiPage::onArticleDelete() and SiteStatsUpdate completing successfully, and there was no exception log entry, so it seems that DataUpdate::runUpdates( $updates ) silently did nothing. The !$content case in WikiPage::getDeletionUpdates() seems like a possible culprit.

With the ContentHandler project, the critical database consistency action of deleting the revisions from the revision table was moved to LinksDeletionUpdate, and is dependent on the content type. This appears to be an error -- page/revision/archive consistency is not content-type-dependent. In MW 1.5, the revision table delete was well-separated from the link table updates, but they were brought together in r15707, and subsequent refactoring inappropriately maintained this close association.

After the botched deletion, the binlogs show:

* At 2013-09-01 13:29:57, Kattenkruid attempted to undelete the article. No revisions were inserted into the revision table, presumably because the if ( $exists ) case was hit in PageArchive::undeleteRevisions(). The archive table rows were deleted. The action was not logged, so presumably there was some kind of additional failure. At this point, there would have been a page with no revisions, which is not normally possible.

* At 13:31:21, Kattenkruid deleted the revisionless page.
* At 2013-09-04 20:26:37, "Look Sharp!" recreated the page by editing it.
* At 20:26:47, "Look Sharp!" deleted the page, generating one archive row.

The orphaned revision rows are still present in the table (rev_ids 38833406, 38833414), and I can easily recover them by connecting them to a page.
Comment 5 Tim Starling 2013-10-01 01:33:53 UTC
Added Daniel Kinzler to the CC list, since he is a relevant developer.
Comment 6 Tim Starling 2013-10-01 01:35:47 UTC
Created attachment 13415 [details]
Binlog excerpt

Some relevant binlog entries, with annotations
Comment 7 Trijnstel 2013-10-01 10:00:24 UTC
(In reply to comment #4)
> The binlogs show:
> 
> * The article was created by an anonymous user at 2013-08-31 20:30:09
> * The article was edited by Ronn at 20:31:00, apparently tagging it for
> deletion
> * Later in the same second (20:31:00), the article was deleted by Kattenkruid
> 
> The deletion action went awry. The revisions were copied into the archive
> table, but they were never deleted from the revision table. The most likely
> reason for this appears to be a failure of WikiPage::getContent(). The binlog
> shows WikiPage::onArticleDelete() and SiteStatsUpdate completing
> successfully,
> and there was no exception log entry, so it seems that
> DataUpdate::runUpdates(
> $updates ) silently did nothing. The !$content case in
> WikiPage::getDeletionUpdates() seems like a possible culprit.
> 
> With the ContentHandler project, the critical database consistency action of
> deleting the revisions from the revision table was moved to
> LinksDeletionUpdate, and is dependent on the content type. This appears to be
> an error -- page/revision/archive consistency is not content-type-dependent.
> In
> MW 1.5, the revision table delete was well-separated from the link table
> updates, but they were brought together in r15707, and subsequent refactoring
> inappropriately maintained this close association.
> 
> After the botched deletion, the binlogs show:
> 
> * At 2013-09-01 13:29:57, Kattenkruid attempted to undelete the article. No
> revisions were inserted into the revision table, presumably because the if (
> $exists ) case was hit in PageArchive::undeleteRevisions(). The archive table
> rows were deleted. The action was not logged, so presumably there was some
> kind
> of additional failure. At this point, there would have been a page with no
> revisions, which is not normally possible.
> 
> * At 13:31:21, Kattenkruid deleted the revisionless page.
> * At 2013-09-04 20:26:37, "Look Sharp!" recreated the page by editing it.
> * At 20:26:47, "Look Sharp!" deleted the page, generating one archive row.
> 
> The orphaned revision rows are still present in the table (rev_ids 38833406,
> 38833414), and I can easily recover them by connecting them to a page.

Thanks for the detailed explanation, Tim! Yes, please, could you recover the deleted edits? (if it's not too much) I'm intended to restore the page or so, but it's always useful to have all the contribs and deleted contribs around.

Also: is it possible to check whether this has happened elsewhere too?
Comment 8 Tim Starling 2013-10-04 00:07:09 UTC
(In reply to comment #7)
> Thanks for the detailed explanation, Tim! Yes, please, could you recover the
> deleted edits? (if it's not too much) I'm intended to restore the page or so,
> but it's always useful to have all the contribs and deleted contribs around.

Done.

> Also: is it possible to check whether this has happened elsewhere too?

I will work on it.
Comment 9 Tim Starling 2013-10-04 02:22:56 UTC
The content of attachment 13415 [details] has been deleted by
    Tim Starling <tstarling@wikimedia.org>
who provided the following reason:

contains private IP address

The token used to delete this attachment was generated at 2013-10-04 02:22:01 UTC.
Comment 10 Gerrit Notification Bot 2013-10-04 04:43:25 UTC
Change 87505 had a related patch set uploaded by Tim Starling:
Fix revision table cleanup on delete

https://gerrit.wikimedia.org/r/87505
Comment 11 Gerrit Notification Bot 2013-10-08 20:36:47 UTC
Change 87505 merged by jenkins-bot:
Fix revision table cleanup on delete

https://gerrit.wikimedia.org/r/87505
Comment 12 Gerrit Notification Bot 2013-10-08 20:51:35 UTC
Change 88632 had a related patch set uploaded by Aaron Schulz:
Fix revision table cleanup on delete

https://gerrit.wikimedia.org/r/88632
Comment 13 Gerrit Notification Bot 2013-10-08 21:33:22 UTC
Change 88632 merged by jenkins-bot:
Fix revision table cleanup on delete

https://gerrit.wikimedia.org/r/88632
Comment 14 Gerrit Notification Bot 2013-10-08 23:29:29 UTC
Change 88667 had a related patch set uploaded by Aaron Schulz:
Fix revision table cleanup on delete

https://gerrit.wikimedia.org/r/88667
Comment 15 Gerrit Notification Bot 2013-10-08 23:36:56 UTC
Change 88667 merged by Aaron Schulz:
Fix revision table cleanup on delete

https://gerrit.wikimedia.org/r/88667
Comment 16 Gerrit Notification Bot 2013-10-08 23:48:15 UTC
Change 88671 had a related patch set uploaded by Aaron Schulz:
Fix revision table cleanup on delete

https://gerrit.wikimedia.org/r/88671
Comment 17 Gerrit Notification Bot 2013-10-08 23:50:44 UTC
Change 88671 abandoned by Aaron Schulz:
Fix revision table cleanup on delete

https://gerrit.wikimedia.org/r/88671
Comment 18 Gerrit Notification Bot 2013-10-09 05:57:51 UTC
Change 88686 had a related patch set uploaded by Aaron Schulz:
Fix revision table cleanup on delete

https://gerrit.wikimedia.org/r/88686
Comment 19 Gerrit Notification Bot 2013-10-09 06:02:32 UTC
Change 88686 merged by jenkins-bot:
Fix revision table cleanup on delete

https://gerrit.wikimedia.org/r/88686
Comment 20 Gerrit Notification Bot 2013-10-09 17:14:54 UTC
Change 88761 had a related patch set uploaded by Aaron Schulz:
Fixed trx isolation bug that could cause text not to be found

https://gerrit.wikimedia.org/r/88761
Comment 21 Gerrit Notification Bot 2013-10-09 23:48:07 UTC
Change 88761 merged by jenkins-bot:
Fixed trx isolation bug that could cause text not to be found

https://gerrit.wikimedia.org/r/88761
Comment 22 Andre Klapper 2013-11-04 23:58:05 UTC
Is more work needed or can this be considered FIXED?
Comment 23 Gerrit Notification Bot 2013-11-05 05:07:27 UTC
Change 93645 had a related patch set uploaded by Tim Starling:
[WIP] Script to fix bug 53687 (failure of revision row deletion)

https://gerrit.wikimedia.org/r/93645
Comment 24 Gerrit Notification Bot 2013-11-06 03:59:28 UTC
Change 93645 merged by jenkins-bot:
Script to fix bug 53687 (failure of revision row deletion)

https://gerrit.wikimedia.org/r/93645
Comment 25 Tim Starling 2013-11-06 05:20:35 UTC
I ran the cleanup script on all affected wikis except Wikidata. On wikidatawiki, the dry run output was unusual, indicating the presence of another bug. So this bug is close enough to fixed for me.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links