there are numerous entries in the logs like this:
Expectation (masterConns <= 0) by MediaWiki::main not met: [connect to 10.64.32.28 (wikidatawiki)] TransactionProfiler.php line 307 calls wfBacktrace() TransactionProfiler.php line 146 calls TransactionProfiler->reportExpectationViolated() LoadBalancer.php line 545 calls TransactionProfiler->recordConnection() DBAccessBase.php line 61 calls LoadBalancer->getConnection() WikiPageEntityMetaDataLookup.php line 161 calls DBAccessBase->getConnection() WikiPageEntityMetaDataLookup.php line 70 calls Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup->selectRevisionInformationMultiple() PrefetchingWikiPageEntityMetaDataAccessor.php line 192 calls Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup->loadRevisionInformation() PrefetchingWikiPageEntityMetaDataAccessor.php line 161 calls Wikibase\Lib\Store\Sql\PrefetchingWikiPageEntityMetaDataAccessor->doFetch() WikiPageEntityRevisionLookup.php line 78 calls Wikibase\Lib\Store\Sql\PrefetchingWikiPageEntityMetaDataAccessor->loadRevisionInformation() CachingEntityRevisionLookup.php line 148 calls Wikibase\Lib\Store\WikiPageEntityRevisionLookup->getEntityRevision() CachingEntityRevisionLookup.php line 131 calls Wikibase\Lib\Store\CachingEntityRevisionLookup->fetchEntityRevision() CachingEntityRevisionLookup.php line 148 calls Wikibase\Lib\Store\CachingEntityRevisionLookup->getEntityRevision() CachingEntityRevisionLookup.php line 131 calls Wikibase\Lib\Store\CachingEntityRevisionLookup->fetchEntityRevision() RevisionBasedEntityLookup.php line 41 calls Wikibase\Lib\Store\CachingEntityRevisionLookup->getEntityRevision() - line - calls Wikibase\Lib\Store\RevisionBasedEntityLookup->getEntity() EntityRedirectResolvingDecorator.php line 79 calls call_user_func_array() RedirectResolvingEntityLookup.php line 50 calls Wikibase\Lib\Store\EntityRedirectResolvingDecorator->__call() WikibaseLuaBindings.php line 199 calls Wikibase\Lib\Store\RedirectResolvingEntityLookup->getEntity() Scribunto_LuaWikibaseLibrary.php line 336 calls Wikibase\Client\DataAccess\Scribunto\WikibaseLuaBindings->getSiteLinkPageName() Engine.php line 384 calls Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary->getSiteLinkPageName() - line - calls Scribunto_LuaSandboxCallback->__call() Engine.php line 297 calls LuaSandboxFunction->call() LuaCommon.php line 238 calls Scribunto_LuaSandboxInterpreter->callFunction() LuaCommon.php line 864 calls Scribunto_LuaEngine->executeModule() Hooks.php line 116 calls Scribunto_LuaModule->invoke() Parser.php line 3774 calls ScribuntoHooks::invokeHook() Parser.php line 3508 calls Parser->callParserFunction() Preprocessor_Hash.php line 1100 calls Parser->braceSubstitution() Preprocessor_Hash.php line 1537 calls PPFrame_Hash->expand() Parser.php line 3647 calls PPTemplateFrame_Hash->cachedExpand() Preprocessor_Hash.php line 1100 calls Parser->braceSubstitution() Parser.php line 3327 calls PPFrame_Hash->expand() Parser.php line 1231 calls Parser->replaceVariables() Parser.php line 434 calls Parser->internalParse() WikitextContent.php line 331 calls Parser->parse() AbstractContent.php line 497 calls WikitextContent->fillParserOutput() PoolWorkArticleView.php line 140 calls AbstractContent->getParserOutput() PoolCounterWork.php line 123 calls PoolWorkArticleView->doWork() Article.php line 676 calls PoolCounterWork->execute() ViewAction.php line 44 calls Article->view() MediaWiki.php line 456 calls ViewAction->show() MediaWiki.php line 255 calls MediaWiki->performAction() MediaWiki.php line 677 calls MediaWiki->performRequest() MediaWiki.php line 474 calls MediaWiki->main() index.php line 41 calls MediaWiki->run() index.php line 3 calls include()
these also occur in other contexts where WikiPageEntityMetaDataLookup.
I see two issues here:
1 ) I think WikiPageEntityMetaDataLookup should only fallback to master when EntityRevisionLookup::LATEST_FROM_MASTER is explicitly set. Right now, we might have a list of ids and some are deleted. They are not found on a slave db and then we check master.
I don't think such check should be done in this case. (only do in cases where need to worry about slave lag)
- getSiteLinkPageName should not need to load the full entity. We can use SiteLinkLookup here. (yes, that has the issue that we still do not badges in the SiteLink objects here -- which we really should fix!) But if all we want is page name, then SiteLinkLookup would work and would be less evil than loading the entity.