r78555 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78554‎ | r78555 | r78556 >
Date:02:55, 18 December 2010
Author:dantman
Status:deferred
Tags:
Comment:
We have a number of separate sql calls in SMW::deleteSemanticData, some of these can generate the lock timeout issues like SMW::updateData. Adding a little identifier so that when doing light debugging you actually know which part of deleteSemanticData the error was thrown at.
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php
@@ -2318,20 +2318,20 @@
23192319
23202320 foreach ( self::getPropertyTables() as $proptable ) {
23212321 if ( $proptable->idsubject ) {
2322 - $db->delete( $proptable->name, array( 's_id' => $id ), $fname );
 2322+ $db->delete( $proptable->name, array( 's_id' => $id ), "$fname::deleteById" );
23232323 } elseif ( $proptable->name != 'smw_redi2' ) { /// NOTE: redirects are handled by updateRedirects(), not here!
2324 - $db->delete( $proptable->name, array( 's_title' => $subject->getDBkey(), 's_namespace' => $subject->getNamespace() ), $fname );
 2324+ $db->delete( $proptable->name, array( 's_title' => $subject->getDBkey(), 's_namespace' => $subject->getNamespace() ), "$fname::deleteByTitle" );
23252325 }
23262326 }
23272327
23282328 // also find bnodes used by this ID ...
2329 - $res = $db->select( 'smw_ids', 'smw_id', array( 'smw_title' => '', 'smw_namespace' => $id, 'smw_iw' => SMW_SQL2_SMWIW ), $fname );
 2329+ $res = $db->select( 'smw_ids', 'smw_id', array( 'smw_title' => '', 'smw_namespace' => $id, 'smw_iw' => SMW_SQL2_SMWIW ), "$fname::selectBnodes" );
23302330
23312331 // ... and delete them as well
23322332 while ( $row = $db->fetchObject( $res ) ) {
23332333 foreach ( self::getPropertyTables() as $proptable ) {
23342334 if ( $proptable->idsubject ) {
2335 - $db->delete( $proptable->name, array( 's_id' => $row->smw_id ), $fname );
 2335+ $db->delete( $proptable->name, array( 's_id' => $row->smw_id ), "$fname::deleteBnodes" );
23362336 }
23372337 }
23382338 }
@@ -2339,7 +2339,7 @@
23402340 $db->freeResult( $res );
23412341
23422342 // free all affected bnodes in one call:
2343 - $db->update( 'smw_ids', array( 'smw_namespace' => 0 ), array( 'smw_title' => '', 'smw_namespace' => $id, 'smw_iw' => SMW_SQL2_SMWIW ), $fname );
 2343+ $db->update( 'smw_ids', array( 'smw_namespace' => 0 ), array( 'smw_title' => '', 'smw_namespace' => $id, 'smw_iw' => SMW_SQL2_SMWIW ), "$fname::updateBnodes" );
23442344
23452345 wfRunHooks( 'smwDeleteSemanticData', array( $subject ) );
23462346 }
@@ -2549,4 +2549,4 @@
25502550 return self::$prop_tables;
25512551 }
25522552
2553 -}
\ No newline at end of file
 2553+}

Status & tagging log