Last modified: 2012-12-13 11:16:39 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 T38428, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 36428 - Handle item deletion in secondary storage
Handle item deletion in secondary storage
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Highest enhancement (vote)
: ---
Assigned To: Wikidata bugs
storypoints: 5
: testme
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-02 12:16 UTC by denny vrandecic
Modified: 2012-12-13 11:16 UTC (History)
3 users (show)

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


Attachments

Description denny vrandecic 2012-05-02 12:16:18 UTC
When items are created or changed they are added to the secondary storage. When they are deleted, their data needs to be cleaned up afterwards.
Comment 1 denny vrandecic 2012-05-02 12:16:53 UTC
Note ContentHandler::getSecondaryUpdatesForDeletion
Comment 2 jeblad 2012-05-13 16:56:53 UTC
As a consequence of this undeletion of history does not work as the recreation of sitelinks leads to duplicate links in secondary storage.
Comment 3 jeblad 2012-05-13 17:32:50 UTC
Deleted items, then tried an undelete, and then got a failed assertion, possibly because the undeleted content isn't any longer a supported format? Could be a new bug and not related to secondary storage, even if it is triggered by it.

Warning: assert():
Assertion failed in /home/john/Workspace/core/includes/Revision.php on line 908 Call Stack: 0.0000 636320
1. {main}() /home/john/Workspace/core/index.php:0 0.0072 3098752
2. MediaWiki->run() /home/john/Workspace/core/index.php:58 0.0072 3098752
3. MediaWiki->main() /home/john/Workspace/core/includes/Wiki.php:502 0.0127 4111328
4. MediaWiki->performRequest() /home/john/Workspace/core/includes/Wiki.php:592 0.0130 4112040
5. MediaWiki->initializeArticle() /home/john/Workspace/core/includes/Wiki.php:267 0.0133 4148616
6. Article->isRedirect() /home/john/Workspace/core/includes/Wiki.php:364 0.0133 4149008
7. Article->__call() /home/john/Workspace/core/includes/Article.php:0 0.0133 4149640
8. call_user_func_array() /home/john/Workspace/core/includes/Article.php:1868 0.0133 4150008
9. WikiPage->isRedirect() /home/john/Workspace/core/includes/Article.php:0 0.0133 4150088
10. WikiPage->getContent() /home/john/Workspace/core/includes/WikiPage.php:374 0.0148 4161712
11. Revision->getContent() /home/john/Workspace/core/includes/WikiPage.php:493 0.0148 4161792
12. Revision->getContentInternal() /home/john/Workspace/core/includes/Revision.php:839 0.0148 4161792
13. Revision->getContentHandler() /home/john/Workspace/core/includes/Revision.php:867 0.0148 4161952
14. assert() /home/john/Workspace/core/includes/Revision.php:908

Format application/x-wikitext is not supported for content model wikitext

Backtrace:

#0 /home/john/Workspace/core/includes/ContentHandler.php(788): ContentHandler->checkFormat('application/x-w...')
#1 /home/john/Workspace/core/includes/Revision.php(876): WikitextContentHandler->unserializeContent(''''LOKE'''??Con...', 'application/x-w...')
#2 /home/john/Workspace/core/includes/Revision.php(839): Revision->getContentInternal()
#3 /home/john/Workspace/core/includes/WikiPage.php(493): Revision->getContent(1)
#4 /home/john/Workspace/core/includes/WikiPage.php(374): WikiPage->getContent()
#5 [internal function]: WikiPage->isRedirect()
#6 /home/john/Workspace/core/includes/Article.php(1868): call_user_func_array(Array, Array)
#7 /home/john/Workspace/core/includes/Wiki.php(364): Article->__call('isRedirect', Array)
#8 /home/john/Workspace/core/includes/Wiki.php(364): Article->isRedirect()
#9 /home/john/Workspace/core/includes/Wiki.php(267): MediaWiki->initializeArticle()
#10 /home/john/Workspace/core/includes/Wiki.php(592): MediaWiki->performRequest()
#11 /home/john/Workspace/core/includes/Wiki.php(502): MediaWiki->main()
#12 /home/john/Workspace/core/index.php(58): MediaWiki->run()
#13 {main}

Line 908 is the assertion in the following code (From Revision.php)

/**
 * @return ContentHandler
 */
public function getContentHandler() {
	if ( !$this->mContentHandler ) {
		$model = $this->getContentModelName();
		$this->mContentHandler = ContentHandler::getForModelName( model );
		assert( $this->mContentHandler->isSupportedFormat( $this->getContentFormat() ) );
	}
	return $this->mContentHandler;
}
Comment 4 Daniel Kinzler 2012-05-14 07:06:45 UTC
@john: yes, you are correct. After some discussion on wikitech-l, I changed the mime type for wikitext from application/x-wikitext to text/x-wiki.

Note that there is another related change imminent: in the future, content model and content format will be stored as integer ids in the database. This is a performance improvement requested by Asher. I'll write to the list about it.
Comment 5 Daniel Kinzler 2012-05-14 08:49:37 UTC
Right. One situation where this can happen is this:

* a user creates a page using a special content model provided by some extension.
* the page gets deleted
* the extension is disabled
* then the user tries to undelete the page.

In this case, mediawiki doesn't know how to unserialize or display the page's content. Undeletion should and does fail. We could look into showing a nicer error page, but I think the case is so rare that that isn't necessary.
Comment 6 denny vrandecic 2012-06-21 12:35:20 UTC
Need testing.
Comment 7 denny vrandecic 2012-06-28 11:33:20 UTC
Picked up for Sprint 8.
Comment 8 Anja Jentzsch 2012-11-29 12:37:04 UTC
Verified in Wikidata demo time for sprint 8

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


Navigation
Links