Last modified: 2013-12-13 23:11:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T42378, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40378 - Transaction warning: WikiPage::doEdit (User::loadFromDatabase) (TranslateMetadata::get)
Transaction warning: WikiPage::doEdit (User::loadFromDatabase) (TranslateMet...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.20.x
All All
: Unprioritized normal (vote)
: ---
Assigned To: Daniel Kinzler
:
Depends on:
Blocks: 39480
  Show dependency treegraph
 
Reported: 2012-09-20 05:56 UTC by Niklas Laxström
Modified: 2013-12-13 23:11 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Niklas Laxström 2012-09-20 05:56:14 UTC
3 PHP Notice:  WikiPage::doEdit: Transaction already in progress (from DatabaseBase::query (User::loadFromDatabase)),  performing implicit commit! [Called from DatabaseBase::begin in /www/translatewiki.net/w/includes/db/Database.php at line 2888] in /www/translatewiki.net/w/includes/debug/Debug.php on line 282
      6 PHP Notice:  WikiPage::doEdit: Transaction already in progress (from DatabaseBase::query (TranslateMetadata::get)),  performing implicit commit! [Called from DatabaseBase::begin in /www/translatewiki.net/w/includes/db/Database.php at line 2888] in /www/translatewiki.net/w/includes/debug/Debug.php on line 282
Comment 1 Niklas Laxström 2012-09-20 06:02:57 UTC
      1 PHP Notice:  WikiPage::doEdit: Transaction already in progress (from DatabaseBase::query (LinkCache::addLinkObj)),  performing implicit commit! [Called from DatabaseBase::begin in /www/translatewiki.net/w/includes/db/Database.php at line 2888] in /www/translatewiki.net/w/includes/debug/Debug.php on line 282
Comment 2 Daniel Kinzler 2012-09-22 10:22:39 UTC
Seeing that WikiPage::doEdit is called while transactions from TranslateMetadata::get, User::loadFromDatabase, and LinkCache::addLinkObj are still in progress seems odd, and quite broken. Needs fixing...

Niklas, can you please investigat the case of TranslateMetadata::get?

I suspect that issues like https://bugzilla.wikimedia.org/show_bug.cgi?id=37225 are caused by transaction being broken by this kind of incorrect transaction behavior. Supporting nested transactions in mediawiki would probably elevate the problem, but care must still be taken to match every begin with a commit or rollback.
Comment 3 Niklas Laxström 2012-09-22 17:01:45 UTC
I don't know what to investigate. The code for TranslateMetadata::get is very simple, I don't see how it would start or end transaction:

	public static function get( $group, $key ) {
		if ( self::$cache === null ) {
			$dbr = wfGetDB( DB_SLAVE );
			self::$cache = $dbr->select( 'translate_metadata', '*', array(), __METHOD__ );
		}

		foreach ( self::$cache as $row ) {
			if ( $row->tmd_group === $group && $row->tmd_key === $key ) {
				return $row->tmd_value;
			}
		}

		return false;
	}
Comment 4 Aaron Schulz 2012-09-22 17:09:31 UTC
Don't forget implicit transactions (DBO_TRX). They cause this error more with single DB setups, since getting a DB with DB_SLAVE still gives the master. This is why I made https://gerrit.wikimedia.org/r/#/c/24655/ yesterday.
Comment 5 Daniel Kinzler 2012-09-22 19:37:30 UTC
(In reply to comment #4)
> Don't forget implicit transactions (DBO_TRX). They cause this error more with
> single DB setups, since getting a DB with DB_SLAVE still gives the master. This
> is why I made https://gerrit.wikimedia.org/r/#/c/24655/ yesterday.

Thanks Aaron for pointing to DBO_TRX, I didn't even know that existed. Does that mean that wfGetDB() may implicitly start a transaction? That would be quite horrible - because that would kill any transaction that is already open!

The current transaction level and possible support (or lack of support) for nested transactions must be considered in any such automatism. I suppose that needs more investigation. 

(Still - note that the new warnings do not cause the actual problem with that behavior, they just expose them).
Comment 6 Aaron Schulz 2012-10-17 21:36:00 UTC
Is this still an issue?
Comment 7 Siebrand Mazeland 2012-10-17 21:46:55 UTC
As the warnings were killed, I guess not. Once the warning are enabled again, probably still (?).
Comment 8 Aaron Schulz 2012-10-29 22:31:19 UTC
These notices have been fixed by now (in the trx warning saga).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links