Page MenuHomePhabricator

Transaction of DatabaseUpdater may get out of sync when populate script does own transaction handling
Closed, ResolvedPublic

Description

Seen the following while running an update.php

Notice: PopulateLogUsertext::doDBUpdates: Transaction already in progress (from DatabaseUpdater::doUpdates), performing implicit commit! [Called from DatabaseBase::begin in \includes\db\Database.php at line 3592] in \includes\debug\MWDebug.php on line 300

The problem here is that the DatabaseUpdater starts a transaction before running all the changes, but the maintenance script populateLogUserText.php also has begin/commit in it.

I am not sure if it is okay to just remove the begin/commit because when running the script standalone that does not make problems.

Details

Related Gerrit Patches:

Event Timeline

Umherirrender raised the priority of this task from to Needs Triage.
Umherirrender updated the task description. (Show Details)
Umherirrender added a subscriber: Umherirrender.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 12 2015, 5:40 PM
Aklapper triaged this task as Medium priority.Feb 13 2015, 3:38 PM

I ran into this same issue trying to install Extension:PageAssessments. This was within vagrant, where I first ran php update.php, then once it errored out I realized I should have ran mwscript update.php. I tried that and it also failed with the same error. I also had Extension:Gadgets installed, but otherwise my vagrant was in a fresh, untouched state.

Hope this helps.

bd808 added a subscriber: bd808.

The error @MusikAnimal saw is

DBUnexpectedError from line 2592 of /vagrant/mediawiki/includes/db/Database.php: PopulateLogUsertext::doDBUpdates: Transaction already in progress (from DatabaseUpdater::doUpdates),  performing implicit commit!

I finally had success by killing and rebuilding vagrant, then vagrant git-update before installing any extensions.

Change 298183 had a related patch set uploaded (by Aaron Schulz):
Unbreak the DB updater by removing transaction from doUpdates()

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

Change 298183 merged by jenkins-bot:
Unbreak the DB updater by removing transaction from doUpdates()

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

Umherirrender closed this task as Resolved.Sep 2 2016, 8:36 AM
Umherirrender assigned this task to aaron.