The DBPerformance contains several warnings about unexpected DB_MASTER connections on GET requests from CentralAuth special pages.
Logstash: https://logstash.wikimedia.org/goto/80e6ec068512bab1687d248131bbee51
- CentralAuthGroupMembershipProxy
- Special:GlobalRenameRequest
- Special:CentralLogin
- Special:GlobalRenameQueue
CentralAuthGroupMembershipProxy
- Request ID: XW8QQwpAADkAAGvZccAAAAAF
- Request URL: GET /w/index.php?user=Krinkle&title=Special%3AGlobalUserRights
Expectation (masterConns <= 0) by MediaWiki::main not met (actual: 1): [connect to 10.64.48.15 (centralauth)] #5 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(269): CentralAuthUtils::getCentralDB() #6 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(472): CentralAuthUser->getSafeReadDB() #7 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(415): CentralAuthUser->loadFromDatabase() #8 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(588): CentralAuthUser->loadState() #9 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(685): CentralAuthUser->getId() #10 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthGroupMembershipProxy.php(50): CentralAuthUser->exists() #11 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/specials/SpecialGlobalGroupMembership.php(112): CentralAuthGroupMembershipProxy::newFromName() #12 /srv/mediawiki/php-1.34.0-wmf.20/includes/specials/SpecialUserrights.php(108): SpecialGlobalGroupMembership->fetchUser() #13 /srv/mediawiki/php-1.34.0-wmf.20/includes/specialpage/SpecialPage.php(573): UserrightsPage->execute() … #18 /srv/mediawiki/php-1.34.0-wmf.20/index.php(42): MediaWiki->run()
The caller doesn't appear to need a master DB (not sure?) and isn't specifically asking for it. But, it uses the CentralAuthGroupMembershipProxy class which is hardcoded to obtain a master connection. That seems problematic.
Special:GlobalRenameRequest
- Request ID: XW8ZGQpAICAAACgl7RwAAABE
- Request URL: GET /wiki/Special:GlobalRenameRequest
Expectation (masterConns <= 0) by MediaWiki::main not met (actual: 1): [connect to 10.64.48.15 (centralauth)] #5 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(269): CentralAuthUtils::getCentralDB() #6 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(472): CentralAuthUser->getSafeReadDB() #7 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(415): CentralAuthUser->loadFromDatabase() #8 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(588): CentralAuthUser->loadState() #9 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(685): CentralAuthUser->getId() #10 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/GlobalRename/GlobalRenameRequest.php(434): CentralAuthUser->exists() #11 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/specials/SpecialGlobalRenameRequest.php(211): GlobalRenameRequest::isNameAvailable() #12 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/specials/SpecialGlobalRenameRequest.php(152): SpecialGlobalRenameRequest->suggestedUsername() #13 /srv/mediawiki/php-1.34.0-wmf.20/includes/specialpage/FormSpecialPage.php(121): SpecialGlobalRenameRequest->getFormFields() #14 /srv/mediawiki/php-1.34.0-wmf.20/includes/specialpage/FormSpecialPage.php(183): FormSpecialPage->getForm() #15 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/specials/SpecialGlobalRenameRequest.php(89): FormSpecialPage->execute() #16 /srv/mediawiki/php-1.34.0-wmf.20/includes/specialpage/SpecialPage.php(573): SpecialGlobalRenameRequest->execute() … #21 /srv/mediawiki/php-1.34.0-wmf.20/index.php(42): MediaWiki->run()
Upon opening the special page form (viewing, not submitting), it calls GlobalRenameRequest::isNameAvailable which is hardwired to obtain a master instance. If don't know if it relies on that, but either that method or the call to it needs to change.
Special:CentralLogin
- Request ID: XW8VAgpAADkAAFJxY88AAABR
- Request URL: loginwiki GET /wiki/Special:CentralLogin/start?token=…&cpPosIndex=1 (referer ja.wikipedia.org)
Expectation (masterConns <= 0) by MediaWiki::main not met (actual: 2): [connect to 10.64.48.15 (centralauth)] … #5 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(269): CentralAuthUtils::getCentralDB() #6 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(472): CentralAuthUser->getSafeReadDB() #7 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(415): CentralAuthUser->loadFromDatabase() #8 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(588): CentralAuthUser->loadState() #9 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(685): CentralAuthUser->getId() #10 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/specials/SpecialCentralLogin.php(79): CentralAuthUser->exists() #11 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/specials/SpecialCentralLogin.php(97): Closure$SpecialCentralLogin::doLoginStart() #12 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/specials/SpecialCentralLogin.php(50): SpecialCentralLogin->doLoginStart() #13 /srv/mediawiki/php-1.34.0-wmf.20/includes/specialpage/SpecialPage.php(573): SpecialCentralLogin->execute() … #18 /srv/mediawiki/php-1.34.0-wmf.20/index.php(42): MediaWiki->run()
In SpecialCentralLogin->doLoginStart, a check is made for the replica DB, and if the user is not found, it then retries from a master DB. This seems intentional, but I'm not sure it is still needed.
For one, chronology protector should be taking care of this already by ensuring we have a replica that has caught up with the events of the user sign up. But the, why is it reaching the else clause? Perhaps this is an error case where the user doesn't exist at all. If so, then it'd be preferable not to handle errors by burdening the master with an impossible query. Alternatively, if we do need this and it's working fine, it should probably opt-out from the TrxProfiler the same way that e.g. RollbackAction does.
Special:GlobalRenameQueue
- Request ID: XW63AgpAAEUAAFT6tf8AAACL
- Request URL: GET /wiki/Special:GlobalRenameQueue/request/ …<number>…
Expectation (masterConns <= 0) by MediaWiki::main not met (actual: 1): [connect to 10.64.48.15 (centralauth)] … #5 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(269): CentralAuthUtils::getCentralDB() #6 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(472): CentralAuthUser->getSafeReadDB() #7 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(415): CentralAuthUser->loadFromDatabase() #8 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/CentralAuthUser.php(705): CentralAuthUser->loadState() #9 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/specials/SpecialGlobalRenameUser.php(227): CentralAuthUser->isHidden() #10 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/specials/SpecialGlobalRenameQueue.php(427): SpecialGlobalRenameUser->processAntiSpoofConflicts() #11 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/specials/SpecialGlobalRenameQueue.php(244): SpecialGlobalRenameQueue->doShowProcessForm() #12 /srv/mediawiki/php-1.34.0-wmf.20/extensions/CentralAuth/includes/specials/SpecialGlobalRenameQueue.php(74): SpecialGlobalRenameQueue->handleProcessRequest() #13 /srv/mediawiki/php-1.34.0-wmf.20/includes/specialpage/SpecialPage.php(573): SpecialGlobalRenameQueue->execute() … #19 /srv/mediawiki/w/index.php(3): include()
The SpecialGlobalRenameUser->processAntiSpoofConflicts method is hardwired to obtain a master connection. Either needs to change, support both, or not be used when displaying the page in question.
See also: