Last modified: 2013-02-20 23:29:38 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 T44600, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42600 - [Regression] removeUnusedAccounts.php broken (uncommitted transaction)
[Regression] removeUnusedAccounts.php broken (uncommitted transaction)
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Maintenance scripts (Other open bugs)
unspecified
All All
: Normal normal (vote)
: 1.21.0 release
Assigned To: Tyler Romeo
: code-update-regression
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-01 11:01 UTC by Krinkle
Modified: 2013-02-20 23:29 UTC (History)
2 users (show)

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


Attachments

Description Krinkle 2012-12-01 11:01:12 UTC
It was hard to debug this one because we don't log the $fname for BEGIN/COMMIT (bug 42598).

The delete('user', ..) query in removeUnusedAccounts.php triggers an automatic transaction begin() call, from Database::query() via Database::delete():


> # If DBO_TRX is set, start a transaction
> if ( ( $this->mFlags & DBO_TRX ) && !$this->mTrxLevel &&
> 	$sql != 'BEGIN' && $sql != 'COMMIT' && $sql != 'ROLLBACK'
> ) {
> 	if ( strpos( $sqlstart, "SHOW " ) !== 0 && strpos( $sqlstart, "SET " ) !== 0 ) {
> 		$this->begin( __METHOD__ . " ($fname)" );
> 		$this->mTrxAutomatic = true;
> 	}
> }

However it isn't committed anywhere.

The SQL debug log looks like this:


Query krinkle_betawiki (2879) (slave): BEGIN /* RemoveUnusedAccounts::isInactiveAccount Krinkle */ 
Query krinkle_betawiki (2880) (slave): SELECT /* RemoveUnusedAccounts::isInactiveAccount Krinkle */  COUNT(*)  FROM `mw_revision`  WHERE rev_user = '406'  LIMIT 1  
Query krinkle_betawiki (2881) (slave): SELECT /* RemoveUnusedAccounts::isInactiveAccount Krinkle */  COUNT(*)  FROM `mw_archive`  WHERE ar_user = '406'  LIMIT 1  
Query krinkle_betawiki (2882) (slave): SELECT /* RemoveUnusedAccounts::isInactiveAccount Krinkle */  COUNT(*)  FROM `mw_image`  WHERE img_user = '406'  LIMIT 1  
Query krinkle_betawiki (2883) (slave): SELECT /* RemoveUnusedAccounts::isInactiveAccount Krinkle */  COUNT(*)  FROM `mw_oldimage`  WHERE oi_user = '406'  LIMIT 1  
Query krinkle_betawiki (2884) (slave): SELECT /* RemoveUnusedAccounts::isInactiveAccount Krinkle */  COUNT(*)  FROM `mw_filearchive`  WHERE fa_user = '406'  LIMIT 1  
Query krinkle_betawiki (2885) (slave): COMMIT /* RemoveUnusedAccounts::isInactiveAccount Krinkle */ 
Query krinkle_betawiki (2886) (slave): BEGIN /* DatabaseBase::query (RemoveUnusedAccounts::execute) Krinkle */ 
Query krinkle_betawiki (2887) (slave): DELETE /* RemoveUnusedAccounts::execute Krinkle */ FROM `mw_user` WHERE user_id IN ('44','45','46','48','50','51','52','53','54','56','62','64','66','67','69','70','73','76','77','78','79','81','82','83','84','86','87','90','91','92','93','96','104','105','106','111','112','113','118','119','123','126','131','133','137','138','141','142','144','145','148','151','152','157','158','160','162','163','164','165','166','167','170','171','172','173','174','176','177','179','180','181','183','184','186
Query krinkle_betawiki (2888) (slave): DELETE /* RemoveUnusedAccounts::execute Krinkle */ FROM `mw_logging` WHERE log_user IN ('44','45','46','48','50','51','52','53','54','56','62','64','66','67','69','70','73','76','77','78','79','81','82','83','84','86','87','90','91','92','93','96','104','105','106','111','112','113','118','119','123','126','131','133','137','138','141','142','144','145','148','151','152','157','158','160','162','163','164','165','166','167','170','171','172','173','174','176','177','179','180','181','183','184',
Query krinkle_betawiki (2889) (slave): DELETE /* RemoveUnusedAccounts::execute Krinkle */ FROM `mw_recentchanges` WHERE rc_user IN ('44','45','46','48','50','51','52','53','54','56','62','64','66','67','69','70','73','76','77','78','79','81','82','83','84','86','87','90','91','92','93','96','104','105','106','111','112','113','118','119','123','126','131','133','137','138','141','142','144','145','148','151','152','157','158','160','162','163','164','165','166','167','170','171','172','173','174','176','177','179','180','181','183','

.. and that's the end of it, after this the execution naturally terminates from the maintenance script.
Comment 1 Tyler Romeo 2013-02-11 03:36:00 UTC
It seems this is primarily because doMaintenance.php fails to close the database connections properly like is done in index.php.

https://gerrit.wikimedia.org/r/48412
Comment 2 Tyler Romeo 2013-02-20 20:23:09 UTC
Merged.

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


Navigation
Links