PageTriage performs unexpected db writes on GET request (TransactionProfiler warning from ArticleCompileProcessor)
Closed, ResolvedPublic

Description

While investigating T154719, I came across many (~6500 in the last week) warnings like this one.

Expectation (writes <= 0) by MediaWiki::restInPeace not met (actual: 18):
query-m: REPLACE INTO `pagetriage_page_tags` (ptrpt_page_id,ptrpt_tag_id,ptrpt_value) VALUES ('X') [TRX#cd3e06]
#0 /srv/mediawiki/php-1.32.0-wmf.12/includes/libs/rdbms/TransactionProfiler.php(219): Wikimedia\Rdbms\TransactionProfiler->reportExpectationViolated()
#1 /srv/mediawiki/php-1.32.0-wmf.12/includes/libs/rdbms/database/Database.php(1243): Wikimedia\Rdbms\TransactionProfiler->recordQueryCompletion()
#2 /srv/mediawiki/php-1.32.0-wmf.12/includes/libs/rdbms/database/Database.php(1143): Wikimedia\Rdbms\Database->doProfiledQuery()
#3 /srv/mediawiki/php-1.32.0-wmf.12/includes/libs/rdbms/database/Database.php(2772): Wikimedia\Rdbms\Database->query()
#4 /srv/mediawiki/php-1.32.0-wmf.12/includes/libs/rdbms/database/DatabaseMysqlBase.php(518): Wikimedia\Rdbms\Database->nativeReplace()
#5 /srv/mediawiki/php-1.32.0-wmf.12/extensions/PageTriage/includes/ArticleCompile/ArticleCompileProcessor.php(243): Wikimedia\Rdbms\DatabaseMysqlBase->replace()
#6 /srv/mediawiki/php-1.32.0-wmf.12/extensions/PageTriage/includes/ArticleCompile/ArticleCompileProcessor.php(129): MediaWiki\Extension\PageTriage\ArticleCompile\ArticleCompileProcessor->save()
#7 /srv/mediawiki/php-1.32.0-wmf.12/includes/deferred/MWCallableUpdate.php(34): Closure$MediaWiki\Extension\PageTriage\ArticleCompile\ArticleCompileProcessor::compileMetadata()
#8 /srv/mediawiki/php-1.32.0-wmf.12/includes/deferred/DeferredUpdates.php(268): MWCallableUpdate->doUpdate()
#9 /srv/mediawiki/php-1.32.0-wmf.12/includes/deferred/DeferredUpdates.php(214): DeferredUpdates::runUpdate()
#10 /srv/mediawiki/php-1.32.0-wmf.12/includes/deferred/DeferredUpdates.php(134): DeferredUpdates::execute()
#11 /srv/mediawiki/php-1.32.0-wmf.12/includes/MediaWiki.php(913): DeferredUpdates::doUpdates()
#12 /srv/mediawiki/php-1.32.0-wmf.12/includes/MediaWiki.php(733): MediaWiki->restInPeace()
#13 (): Closure$MediaWiki::doPostOutputShutdown()
#14 {main}

The above is triggered during compilation of article metadata, but the same warning is also generated when User->saveSettings() is invoked by SpecialNewPagesFeed::execute():

Expectation (writes <= 0) by MediaWiki::restInPeace not met (actual: 3):
query-m: RELEASE SAVEPOINT `wikimedia_rdbms_atomic1` [TRX#848b85]
#0 /srv/mediawiki/php-1.32.0-wmf.12/includes/libs/rdbms/TransactionProfiler.php(219): Wikimedia\Rdbms\TransactionProfiler->reportExpectationViolated()
#1 /srv/mediawiki/php-1.32.0-wmf.12/includes/libs/rdbms/database/Database.php(1243): Wikimedia\Rdbms\TransactionProfiler->recordQueryCompletion()
#2 /srv/mediawiki/php-1.32.0-wmf.12/includes/libs/rdbms/database/Database.php(1143): Wikimedia\Rdbms\Database->doProfiledQuery()
#3 /srv/mediawiki/php-1.32.0-wmf.12/includes/libs/rdbms/database/Database.php(3549): Wikimedia\Rdbms\Database->query()
#4 /srv/mediawiki/php-1.32.0-wmf.12/includes/libs/rdbms/database/Database.php(3635): Wikimedia\Rdbms\Database->doReleaseSavepoint()
#5 /srv/mediawiki/php-1.32.0-wmf.12/includes/libs/rdbms/database/Database.php(3721): Wikimedia\Rdbms\Database->endAtomic()
#6 /srv/mediawiki/php-1.32.0-wmf.12/includes/user/User.php(4219): Wikimedia\Rdbms\Database->doAtomicSection()
#7 /srv/mediawiki/php-1.32.0-wmf.12/extensions/PageTriage/includes/SpecialNewPagesFeed.php(46): User->saveSettings()
#8 /srv/mediawiki/php-1.32.0-wmf.12/includes/deferred/MWCallableUpdate.php(34): Closure$MediaWiki\Extension\PageTriage\SpecialNewPagesFeed::execute()
#9 /srv/mediawiki/php-1.32.0-wmf.12/includes/deferred/DeferredUpdates.php(268): MWCallableUpdate->doUpdate()
#10 /srv/mediawiki/php-1.32.0-wmf.12/includes/deferred/DeferredUpdates.php(214): DeferredUpdates::runUpdate()
#11 /srv/mediawiki/php-1.32.0-wmf.12/includes/deferred/DeferredUpdates.php(134): DeferredUpdates::execute()
#12 /srv/mediawiki/php-1.32.0-wmf.12/includes/MediaWiki.php(913): DeferredUpdates::doUpdates()
#13 /srv/mediawiki/php-1.32.0-wmf.12/includes/MediaWiki.php(733): MediaWiki->restInPeace()
#14 (): Closure$MediaWiki::doPostOutputShutdown()
#15 {main}
kostajh created this task.Jul 16 2018, 2:22 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 16 2018, 2:22 PM
kostajh updated the task description. (Show Details)Jul 16 2018, 2:27 PM
JTannerWMF moved this task from Inbox to To Triage on the Growth-Team board.Jul 18 2018, 6:32 PM
Krinkle renamed this task from Expectation (writes <= 0) by MediaWiki::restInPeace not met (actual: 18): to PageTriage performs unexpected db writes on GET request (TransactionProfiler warning from ArticleCompileProcessor).Jul 25 2018, 7:08 PM
Krinkle triaged this task as Normal priority.
Krinkle moved this task from Limbo to Watching on the Performance-Team (Radar) board.
MMiller_WMF moved this task from To Triage to Q1 2018-19 on the Growth-Team board.Aug 7 2018, 6:25 PM
MMiller_WMF added a subscriber: MMiller_WMF.

Putting this in our Q1 column because it is maintenance we can do while we are working on PageTriage as part of T193782 (and it's already halfway done).

SBisson assigned this task to kostajh.Aug 16 2018, 8:04 PM

Change 446517 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/extensions/PageTriage@master] DBPerformance: Master connections and writes via POST not GET

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

Change 446517 merged by jenkins-bot:
[mediawiki/extensions/PageTriage@master] DBPerformance: Master connections and writes via POST not GET

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

Change 454281 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/extensions/PageTriage@master] Increase accuracy of logging metadata compilation attempts

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

Change 454281 merged by jenkins-bot:
[mediawiki/extensions/PageTriage@master] Increase accuracy of logging metadata compilation attempts

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

Etonkovidova closed this task as Resolved.Aug 22 2018, 10:12 PM