Page MenuHomePhabricator

DBPerformance warning: Unexpected master query on GET from difference page
Closed, ResolvedPublic

Description

Example url:

https://test2.wikipedia.org/w/index.php?title=Main_Page&type=revision&diff=398149&oldid=398020

Error message
Expectation (masterConns <= 0) by MediaWiki::main not met (actual: 1):
[connect to 10.64.0.205 (test2wiki)]
stack
#0 /srv/mediawiki/php-1.34.0-wmf.21/includes/libs/rdbms/TransactionProfiler.php(186): Wikimedia\Rdbms\TransactionProfiler->reportExpectationViolated('masterConns', '[connect to 10....', 1)
#1 /srv/mediawiki/php-1.34.0-wmf.21/includes/libs/rdbms/loadbalancer/LoadBalancer.php(939): Wikimedia\Rdbms\TransactionProfiler->recordConnection('10.64.0.205', 'test2wiki', true)
#2 /srv/mediawiki/php-1.34.0-wmf.21/includes/libs/rdbms/loadbalancer/LoadBalancer.php(895): Wikimedia\Rdbms\LoadBalancer->getServerConnection(0, 'test2wiki', 4)
#3 /srv/mediawiki/php-1.34.0-wmf.21/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1040): Wikimedia\Rdbms\LoadBalancer->getConnection(-2, Array, 'test2wiki', 4)
#4 /srv/mediawiki/php-1.34.0-wmf.21/includes/GlobalFunctions.php(2575): Wikimedia\Rdbms\LoadBalancer->getMaintenanceConnectionRef(-2, Array, 'test2wiki')
#5 /srv/mediawiki/php-1.34.0-wmf.21/includes/block/DatabaseBlock.php(285): wfGetDB(-2)
#6 /srv/mediawiki/php-1.34.0-wmf.21/includes/block/DatabaseBlock.php(1204): MediaWiki\Block\DatabaseBlock::newLoad(Object(User), 1, true, NULL)
#7 /srv/mediawiki/php-1.34.0-wmf.21/includes/block/BlockManager.php(131): MediaWiki\Block\DatabaseBlock::newListFromTarget(Object(User), NULL, true)
#8 /srv/mediawiki/php-1.34.0-wmf.21/includes/user/User.php(1757): MediaWiki\Block\BlockManager->getUserBlock(Object(User), false)
#9 /srv/mediawiki/php-1.34.0-wmf.21/includes/user/User.php(2080): User->getBlockedStatus(false)
#10 /srv/mediawiki/php-1.34.0-wmf.21/includes/Permissions/PermissionManager.php(659): User->getBlock(false)
#11 /srv/mediawiki/php-1.34.0-wmf.21/includes/Permissions/PermissionManager.php(397): MediaWiki\Permissions\PermissionManager->checkUserBlock('rollback', Object(User), Array, 'secure', true, Object(Title))
#12 /srv/mediawiki/php-1.34.0-wmf.21/includes/Permissions/PermissionManager.php(231): MediaWiki\Permissions\PermissionManager->getPermissionErrorsInternal('rollback', Object(User), Object(Title), 'secure', true)
#13 /srv/mediawiki/php-1.34.0-wmf.21/includes/diff/DifferenceEngine.php(548): MediaWiki\Permissions\PermissionManager->userCan('rollback', Object(User), Object(Title))
#14 /srv/mediawiki/php-1.34.0-wmf.21/includes/page/Article.php(935): DifferenceEngine->showDiffPage(false)
#15 /srv/mediawiki/php-1.34.0-wmf.21/includes/page/Article.php(618): Article->showDiffPage()
#16 /srv/mediawiki/php-1.34.0-wmf.21/includes/actions/ViewAction.php(63): Article->view()
#17 /srv/mediawiki/php-1.34.0-wmf.21/includes/MediaWiki.php(507): ViewAction->show()
#18 /srv/mediawiki/php-1.34.0-wmf.21/includes/MediaWiki.php(302): MediaWiki->performAction(Object(Article), Object(Title))
#19 /srv/mediawiki/php-1.34.0-wmf.21/includes/MediaWiki.php(892): MediaWiki->performRequest()
#20 /srv/mediawiki/php-1.34.0-wmf.21/includes/MediaWiki.php(523): MediaWiki->main()
#21 /srv/mediawiki/php-1.34.0-wmf.21/index.php(42): MediaWiki->run()
#22 /srv/mediawiki/w/index.php(3): require('/srv/mediawiki/...')
#23 {main}

It is coming from a (full-secure?) permission check for the rollback link on history pages. I don't see an indication in the code that requires this. Are master-db permission checks the default? If so, was this always the case, or has that changed for PermissionManager and/or the DifferenceEngine call in recent refactoring?

Details

Related Gerrit Patches:

Event Timeline

Krinkle created this task.Sep 7 2019, 6:07 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 7 2019, 6:07 PM

Change 503276 had a related patch set uploaded (by Krinkle; owner: Daimona Eaytoy):
[mediawiki/core@master] DifferenceEngine: Use quickUserCan for display of rollback link

https://gerrit.wikimedia.org/r/503276

Daimona claimed this task.Sep 7 2019, 6:13 PM

Change 503276 merged by jenkins-bot:
[mediawiki/core@master] DifferenceEngine: Use quickUserCan for display of rollback link

https://gerrit.wikimedia.org/r/503276

Daimona closed this task as Resolved.Sep 9 2019, 6:40 PM