Page MenuHomePhabricator

Expectation (writes <= 0) by MediaWiki::main not met after rebuilding localisationCache
Closed, ResolvedPublic

Description

In onw of my production wikis, I enabled the manualRecache for performance reasons, so any time I upgrade the wiki (or change/disable/install an extension with new/updated messages) I re-run rebuildLocalisationCache.php to update the constant database files, which the server uses for messages. Now I discovered, that any time after I re-run the rebuild, I'll get this error in the dbperformance log for the first view action for each language (en, de, ...):

2015-10-29 15:34:03 <servername> <database>: Expectation (writes <= 0) by MediaWiki::main not met:
query-m: INSERT IGNORE INTO `msg_resource` (mr_lang,mr_resource,mr_blob,mr_timestamp) VALUES ('X') [TRX#a936398fa722]
TransactionProfiler.php line 311 calls wfBacktrace()
TransactionProfiler.php line 200 calls TransactionProfiler->reportExpectationViolated()
Database.php line 1006 calls TransactionProfiler->recordQueryCompletion()
Database.php line 1935 calls DatabaseBase->query()
MessageBlobStore.php line 132 calls DatabaseBase->insert()
MessageBlobStore.php line 89 calls MessageBlobStore->insertMessageBlob()
ResourceLoader.php line 969 calls MessageBlobStore->get()
OutputPage.php line 2877 calls ResourceLoader->makeModuleResponse()
OutputPage.php line 3020 calls OutputPage->makeResourceLoaderLink()
OutputPage.php line 2692 calls OutputPage->getInlineHeadScripts()
SkinTemplate.php line 465 calls OutputPage->headElement()
SkinTemplate.php line 240 calls SkinTemplate->prepareQuickTemplate()
OutputPage.php line 2305 calls SkinTemplate->outputPage()
MediaWiki.php line 677 calls OutputPage->output()
MediaWiki.php line 474 calls MediaWiki->main()
index.php line 41 calls MediaWiki->run()

Shouldn't (whatever is done there) be made in the rebuildLocalisation script to avoid such a warning/notice?

Steps to reproduce:

  • Enable the dbperformance log in LocalSettings, e.g.:
$wgDebugLogGroups = array(
   'DBPerformance' => '/var/log/wiki/phplog/dbperformance.log',
);
  • Disable automatic recache of messages, e.g.:
$wgLocalisationCacheConf['manualRecache'] = true;
  • Run the rebuildLocalisationCache.php script (e.g. for en only):
php maintenance/rebuildLocalisationCache.php --lang en
  • Open a wiki page
  • Now look into your dbperformance.log file

Event Timeline

Florian created this task.Oct 29 2015, 3:44 PM
Florian raised the priority of this task from to Needs Triage.
Florian updated the task description. (Show Details)
Florian added a subscriber: Florian.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 29 2015, 3:44 PM
Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptDec 4 2015, 10:34 PM
Krinkle closed this task as Resolved.Aug 5 2016, 2:36 AM
Krinkle claimed this task.
Krinkle added a subscriber: Krinkle.

Per T113092, this msg_resource table no longer exists. Rebuilding localisation caches still calls MessageBlobStore::clear(), but this method no longer touches any database tables.

T113092: Revise the design of ResourceLoader's MessageBlobStore