MediaWiki 1.29.0-alpha (54381ead) PHP 5.6.8 (apache2handler) MySQL 5.6.24 ICU 54.1
Issue
A delete action TestDelete&action=delete to article "TestDelete" throws a:
User: loading options for user 1 from database. OutputPage::sendCacheControl: private caching; ** [exception] [11f4441e5372dd70d3d37066] /mw-master/index.php?title=TestDelete&action=delete DBUnexpectedError from line 2851 of ...\mw-master\includes\libs\rdbms\database\Database.php: MWCallableUpdate::doUpdate: Cannot flush snapshot because writes are pending (JobQueueDB::doBatchPush). #0 ...\mw-master\includes\libs\rdbms\loadbalancer\LoadBalancer.php(1101): Database->flushSnapshot(string) #1 [internal function]: LoadBalancer->{closure}(DatabaseMysqli) #2 ...\mw-master\includes\libs\rdbms\loadbalancer\LoadBalancer.php(1399): call_user_func_array(Closure, array) #3 ...\mw-master\includes\libs\rdbms\loadbalancer\LoadBalancer.php(1109): LoadBalancer->forEachOpenMasterConnection(Closure) #4 [internal function]: LoadBalancer->beginMasterChanges(string) #5 ...\mw-master\includes\libs\rdbms\lbfactory\LBFactory.php(176): call_user_func_array(array, array) #6 [internal function]: LBFactory->{closure}(LoadBalancer, string, array) #7 ...\mw-master\includes\libs\rdbms\lbfactory\LBFactorySimple.php(147): call_user_func_array(Closure, array) #8 ...\mw-master\includes\libs\rdbms\lbfactory\LBFactory.php(179): LBFactorySimple->forEachLB(Closure, array) #9 ...\mw-master\includes\libs\rdbms\lbfactory\LBFactory.php(200): LBFactory->forEachLBCallMethod(string, array) #10 ...\mw-master\includes\deferred\DeferredUpdates.php(262): LBFactory->beginMasterChanges(string) #11 ...\mw-master\includes\deferred\DeferredUpdates.php(225): DeferredUpdates::runUpdate(MWCallableUpdate, LBFactorySimple, integer) #12 ...\mw-master\includes\deferred\DeferredUpdates.php(133): DeferredUpdates::execute(array, string, integer) #13 ...\mw-master\includes\MediaWiki.php(891): DeferredUpdates::doUpdates(string) #14 ...\mw-master\includes\MediaWiki.php(720): MediaWiki->restInPeace(string) #15 ...\mw-master\includes\MediaWiki.php(739): MediaWiki->{closure}() #16 ...\mw-master\includes\MediaWiki.php(543): MediaWiki->doPostOutputShutdown(string) #17 ...\mw-master\index.php(43): MediaWiki->run() #18 {main} [Bug56269] Exception thrown with an uncommited database transaction: [11f4441e5372dd70d3d37066] /mw-master/index.php?title=TestDelete&action=delete DBExpectedError from line 1112 of ...\mw-master\includes\libs\rdbms\loadbalancer\LoadBalancer.php: MWCallableUpdate::doUpdate: Flush failed on server(s) localhost: MWCallableUpdate::doUpdate: Cannot flush snapshot because writes are pending (JobQueueDB::doBatchPush). #0 [internal function]: LoadBalancer->beginMasterChanges(string) #1 ...\mw-master\includes\libs\rdbms\lbfactory\LBFactory.php(176): call_user_func_array(array, array) #2 [internal function]: LBFactory->{closure}(LoadBalancer, string, array) #3 ...\mw-master\includes\libs\rdbms\lbfactory\LBFactorySimple.php(147): call_user_func_array(Closure, array) #4 ...\mw-master\includes\libs\rdbms\lbfactory\LBFactory.php(179): LBFactorySimple->forEachLB(Closure, array) #5 ...\mw-master\includes\libs\rdbms\lbfactory\LBFactory.php(200): LBFactory->forEachLBCallMethod(string, array) #6 ...\mw-master\includes\deferred\DeferredUpdates.php(262): LBFactory->beginMasterChanges(string) #7 ...\mw-master\includes\deferred\DeferredUpdates.php(225): DeferredUpdates::runUpdate(MWCallableUpdate, LBFactorySimple, integer) #8 ...\mw-master\includes\deferred\DeferredUpdates.php(133): DeferredUpdates::execute(array, string, integer) #9 ...\mw-master\includes\MediaWiki.php(891): DeferredUpdates::doUpdates(string) #10 ...\mw-master\includes\MediaWiki.php(720): MediaWiki->restInPeace(string) #11 ...\mw-master\includes\MediaWiki.php(739): MediaWiki->{closure}() #12 ...\mw-master\includes\MediaWiki.php(543): MediaWiki->doPostOutputShutdown(string) #13 ...\mw-master\index.php(43): MediaWiki->run() #14 {main}
SUMMARY OF T165714, T100085, and T154425
All three bugs are related to jobs (background tasks managed asynchronously) and deferred updates (also called deferrable updates, tasks postponed to the end of the request). Some deferred updates can be transformed to jobs. Jobs are usually pushed in the job queue during normal operations, but some jobs are only pushed at a latter time, these are called lazy jobs (short for lazily-pushed jobs). At the end of a MediaWiki request on the Web, deferred updates are executed, then some jobs are executed if the parameter $wgJobRunRate is not 0, and lazy jobs are pushed to the job queue.
- T165714 (duplicates: T154439) (affects: MW 1.28, 1.29, 1.30) Some jobs throw an exception when executed on the Web due to interactions between jobs and deferred updates linked to database transactions; these jobs are never executed and remain in the job queue until deleted. Bug trigerred when $wgJobRunRate > 0 (default) and the job queue is JobQueueDB (default). Fixed by https://gerrit.wikimedia.org/r/#/c/356120/ on 1.28, 1.29, 1.30.
- T100085 (duplicates: T154427) (affects: MW: 1.27, 1.28, 1.29, 1.30) Some lazy jobs added by jobs executed on the Web are not pushed and this triggers an error in the logs; these jobs are never added in the job queue, hence never executed. Bug trigerred when $wgJobRunRate > 0 (default). Fixed by https://gerrit.wikimedia.org/r/#/c/356120/ on 1.27, 1.28, 1.29, 1.30. The fix from T154425 improves the resolution. Possibly other root causes given it happened on Translatewiki and Wikimedia (where $wgJobRunRate is 0).
- T154425 (duplicates: T154438, T157679, T166867, T153849) (affects: MW 1.28, 1.29, 1.30) Some deferred updates are not executed when there exists an EnqueueableDataUpdate (a specific deferrable update, which can be transformed to a job) linked to database transactions; this happens mainly during delete, restore, move operations, possibly some others; these deferred updates are not executed. Bug trigerred when the job queue is JobQueueDB (default). Fixed by https://gerrit.wikimedia.org/r/#/c/356619/ and https://gerrit.wikimedia.org/r/#/c/357966/ in 1.28, 1.29, 1.30.