Page MenuHomePhabricator

Transaction warnings during update.php
Closed, ResolvedPublic

Description

Freshly installed MW. Then loaded a bunch of extensions and ran update.php, resulting in these warnings:

PHP Notice: DatabaseBase::begin: Transaction already in progress (from DatabaseUpdater::doUpdates), performing implicit commit! [Called from DatabaseBase::begin in /home/j/www/phase3/includes/db/Database.php at line 2944] in /home/j/www/phase3/includes/debug/Debug.php on line 282
PHP Stack trace:
PHP 1. {main}() /home/j/www/phase3/maintenance/update.php:0
PHP 2. require_once() /home/j/www/phase3/maintenance/update.php:162
PHP 3. UpdateMediaWiki->execute() /home/j/www/phase3/maintenance/doMaintenance.php:110
PHP 4. DatabaseUpdater->doUpdates() /home/j/www/phase3/maintenance/update.php:126
PHP 5. DatabaseUpdater->runUpdates() /home/j/www/phase3/includes/installer/DatabaseUpdater.php:305
PHP 6. call_user_func_array() /home/j/www/phase3/includes/installer/DatabaseUpdater.php:339
PHP 7. Wikibase\Utils::insertDefaultSites() /home/j/www/phase3/includes/installer/DatabaseUpdater.php:0
PHP 8. DatabaseBase->begin() /home/j/www/phase3/extensions/Wikibase/lib/includes/Utils.php:101
PHP 9. wfWarn() /home/j/www/phase3/includes/db/Database.php:2944
PHP 10. MWDebug::warning() /home/j/www/phase3/includes/GlobalFunctions.php:1103
PHP 11. MWDebug::sendWarning() /home/j/www/phase3/includes/debug/Debug.php:143
PHP 12. trigger_error() /home/j/www/phase3/includes/debug/Debug.php:282

Notice: DatabaseBase::begin: Transaction already in progress (from DatabaseUpdater::doUpdates), performing implicit commit! [Called from DatabaseBase::begin in /home/j/www/phase3/includes/db/Database.php at line 2944] in /home/j/www/phase3/includes/debug/Debug.php on line 282

Call Stack:

0.0003     698216   1. {main}() /home/j/www/phase3/maintenance/update.php:0
0.0027    1300904   2. require_once('/home/j/www/phase3/maintenance/doMaintenance.php') /home/j/www/phase3/maintenance/update.php:162
0.0583   18302528   3. UpdateMediaWiki->execute() /home/j/www/phase3/maintenance/doMaintenance.php:110
0.0764   23372496   4. DatabaseUpdater->doUpdates() /home/j/www/phase3/maintenance/update.php:126
0.3254   24497952   5. DatabaseUpdater->runUpdates() /home/j/www/phase3/includes/installer/DatabaseUpdater.php:305
0.3259   24502400   6. call_user_func_array() /home/j/www/phase3/includes/installer/DatabaseUpdater.php:339
0.3295   24655472   7. Wikibase\Utils::insertDefaultSites() /home/j/www/phase3/includes/installer/DatabaseUpdater.php:0
1.3547   28022528   8. DatabaseBase->begin() /home/j/www/phase3/extensions/Wikibase/lib/includes/Utils.php:101
1.3547   28022928   9. wfWarn() /home/j/www/phase3/includes/db/Database.php:2944
1.3547   28023168  10. MWDebug::warning() /home/j/www/phase3/includes/GlobalFunctions.php:1103
1.3547   28027648  11. MWDebug::sendWarning() /home/j/www/phase3/includes/debug/Debug.php:143
1.3547   28028072  12. trigger_error() /home/j/www/phase3/includes/debug/Debug.php:282

PHP Notice: DatabaseUpdater::doUpdates: No transaction to commit, something got out of sync! [Called from DatabaseBase::commit in /home/j/www/phase3/includes/db/Database.php at line 2991] in /home/j/www/phase3/includes/debug/Debug.php on line 282
PHP Stack trace:
PHP 1. {main}() /home/j/www/phase3/maintenance/update.php:0
PHP 2. require_once() /home/j/www/phase3/maintenance/update.php:162
PHP 3. UpdateMediaWiki->execute() /home/j/www/phase3/maintenance/doMaintenance.php:110
PHP 4. DatabaseUpdater->doUpdates() /home/j/www/phase3/maintenance/update.php:126
PHP 5. DatabaseBase->commit() /home/j/www/phase3/includes/installer/DatabaseUpdater.php:321
PHP 6. wfWarn() /home/j/www/phase3/includes/db/Database.php:2991
PHP 7. MWDebug::warning() /home/j/www/phase3/includes/GlobalFunctions.php:1103
PHP 8. MWDebug::sendWarning() /home/j/www/phase3/includes/debug/Debug.php:143
PHP 9. trigger_error() /home/j/www/phase3/includes/debug/Debug.php:282
Creating ep_orgs table ...done.
...have course_title field in ep_courses table.
...have course_touched field in ep_courses table.
...site_stats is populated...done.
Purging caches...done.

Notice: DatabaseUpdater::doUpdates: No transaction to commit, something got out of sync! [Called from DatabaseBase::commit in /home/j/www/phase3/includes/db/Database.php at line 2991] in /home/j/www/phase3/includes/debug/Debug.php on line 282

Call Stack:

0.0003     698216   1. {main}() /home/j/www/phase3/maintenance/update.php:0
0.0027    1300904   2. require_once('/home/j/www/phase3/maintenance/doMaintenance.php') /home/j/www/phase3/maintenance/update.php:162
0.0583   18302528   3. UpdateMediaWiki->execute() /home/j/www/phase3/maintenance/doMaintenance.php:110
0.0764   23372496   4. DatabaseUpdater->doUpdates() /home/j/www/phase3/maintenance/update.php:126
8.2481   30486680   5. DatabaseBase->commit() /home/j/www/phase3/includes/installer/DatabaseUpdater.php:321
8.2481   30487032   6. wfWarn() /home/j/www/phase3/includes/db/Database.php:2991
8.2481   30487272   7. MWDebug::warning() /home/j/www/phase3/includes/GlobalFunctions.php:1103
8.2482   30488944   8. MWDebug::sendWarning() /home/j/www/phase3/includes/debug/Debug.php:143
8.2482   30489328   9. trigger_error() /home/j/www/phase3/includes/debug/Debug.php:282

Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=41394

Details

Reference
bz41170

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:59 AM
bzimport set Reference to bz41170.
bzimport added a subscriber: Unknown Object (MLST).

DatabaseUpdater::doUpdates wraps all updates in one big transaction (this was introduces by Iebb6855e, apparently to fix some issue with PG). If some DB update registered by an extension tries to open a transaction, that will cause these warnings (if you have $wgDevelopmentWarnings enabled).

Wikibase\Utils::insertDefaultSites() does do that.

There's two possible solutions:

  1. remove the global spanning transaction. That seems to be prudent in the absence of support for nested transactions. But it may break whatever problem was fixed by Iebb6855e.
  1. detect open transactions in Utils::insertDefaultSites(), and only open a transaction if there isn't one already. Also, I'm not sure why Utils::insertDefaultSites() needs a transaction at all. Consistency is not critical here. Is it a performance thing?

patch submitted as I2348c28b

Restricted Application added a project: Wikidata. · View Herald TranscriptJan 28 2016, 6:12 PM
Restricted Application added a subscriber: StudiesWorld. · View Herald Transcript