Page MenuHomePhabricator

Combo of bugs when restoring deleted pages with many revisions
Open, Needs TriagePublic

Description

First of all, I apologize if this task is unclear, or it contains too many issues together. I'm just writing down everything I've just observed, and I'll split it later if necessary.

Context: I wanted to delete a page with roughly 3000 revisions (https://it.wikipedia.org/wiki/Che_Guevara), and selectively restore all but the last 30ish revisions (I have good reasons for not using revdel). This is something which I've done before and I'm comfortable with.

Timeline:

  1. I've deleted the page as usual; the software told me that the deletion was enqueued.
  2. A few seconds later, the page was deleted as expected.
  3. Then I went to Special:Undelete/Che Guevara; I've selected the last ~30 revisions, then clicked "Invert selection", then added a couple of revision amongst the 30s as well.
  4. I clicked "Restore"
  5. First problem The page hanged for a while, then I got a DB exception saying that my write query took 11 seconds and it was killed. You can find it on logstash with ID XduuIQpAADwAAJaE08EAAAAU
  6. I went to Special:Undelete once again, and repeated (3.)
  7. I clicked "Restore", and this time it completed immediately.
  8. Second problem However, the page wasn't restored completely. Specifically, all revisions prior to 2012 weren't restored, as can be seen in the page history https://it.wikipedia.org/w/index.php?title=Che_Guevara&dir=prev&action=history
  9. Third problem Furthermore, the first of the 2 "edits amongst the 30s" mentioned at (3.), the one by 5.90.14.47, is shown as having a diff size of +111 909, but that's obviously wrong if you look at the diff.
  10. I've deleted the page once again, and went to Special:Undelete for the third time.
  11. I tried to open a diff from 2008, for an edit which was probably deleted at the time, according to the deletion log.
  12. Fourth problem It errored out, see https://it.wikipedia.org/w/index.php?title=Speciale:Ripristina&target=Che+Guevara&timestamp=20081019130539&diff=prev; the trace is pasted below.
  13. I repeated (3.) once again, making sure that *all* versions were selected.
  14. The page was restored, but revisions pre-2012 are still missing.

Exception at (12.)

message
[XduzjQpAMFoAABbQta4AAAAY] /w/index.php?title=Speciale:Ripristina&target=Che+Guevara&timestamp=20081019130539&diff=prev&uselang=en   InvalidArgumentException from line 3275 of /srv/mediawiki/php-1.35.0-wmf.5/includes/Revision/RevisionStore.php: Revision 19584762 doesn't belong to page 2104810
trace
#0 /srv/mediawiki/php-1.35.0-wmf.5/includes/Revision/RevisionStore.php(3483): MediaWiki\Revision\RevisionStore->assertRevisionParameter(string, integer, MediaWiki\Revision\RevisionArchiveRecord)
#1 /srv/mediawiki/php-1.35.0-wmf.5/includes/diff/DifferenceEngine.php(1552): MediaWiki\Revision\RevisionStore->countRevisionsBetween(integer, MediaWiki\Revision\RevisionArchiveRecord, MediaWiki\Revision\RevisionArchiveRecord, integer)
#2 /srv/mediawiki/php-1.35.0-wmf.5/includes/diff/DifferenceEngine.php(1052): DifferenceEngine->getMultiNotice()
#3 /srv/mediawiki/php-1.35.0-wmf.5/includes/specials/SpecialUndelete.php(583): DifferenceEngine->getDiff(string, string)
#4 /srv/mediawiki/php-1.35.0-wmf.5/includes/specials/SpecialUndelete.php(429): SpecialUndelete->showDiff(Revision, Revision)
#5 /srv/mediawiki/php-1.35.0-wmf.5/includes/specials/SpecialUndelete.php(204): SpecialUndelete->showRevision(string)
#6 /srv/mediawiki/php-1.35.0-wmf.5/includes/specialpage/SpecialPage.php(575): SpecialUndelete->execute(NULL)
#7 /srv/mediawiki/php-1.35.0-wmf.5/includes/specialpage/SpecialPageFactory.php(607): SpecialPage->run(NULL)
#8 /srv/mediawiki/php-1.35.0-wmf.5/includes/MediaWiki.php(298): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#9 /srv/mediawiki/php-1.35.0-wmf.5/includes/MediaWiki.php(967): MediaWiki->performRequest()
#10 /srv/mediawiki/php-1.35.0-wmf.5/includes/MediaWiki.php(530): MediaWiki->main()
#11 /srv/mediawiki/php-1.35.0-wmf.5/index.php(46): MediaWiki->run()
#12 /srv/mediawiki/w/index.php(3): require(string)
#13 {main}

Event Timeline

There is T239062 for the "Revision doesn't belong to page" error

Krinkle subscribed.

Not tracking as prod-error given it is too generic / tracking other issues.