From d4ed1d29e689bfd90a22c3bb44124dbf12cd9bf5 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 16 Apr 2006 06:31:19 +0000 Subject: [PATCH] Don't lock page table rows --- maintenance/storage/compressOld.inc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/maintenance/storage/compressOld.inc b/maintenance/storage/compressOld.inc index c1fd7049fe..b7d7094f4a 100644 --- a/maintenance/storage/compressOld.inc +++ b/maintenance/storage/compressOld.inc @@ -129,8 +129,9 @@ function compressWithConcat( $startId, $maxChunkSize, $maxChunkFactor, $factorTh } # Don't work with current revisions - $tables[] = 'page'; - $conds[] = 'page_id=rev_page AND rev_id != page_latest'; + # Don't lock the page table for update either -- TS 2006-04-04 + #$tables[] = 'page'; + #$conds[] = 'page_id=rev_page AND rev_id != page_latest'; $oldReadsSinceLastSlaveWait = 0; #check slave lag periodically $totalMatchingRevisions = 0; @@ -142,7 +143,8 @@ function compressWithConcat( $startId, $maxChunkSize, $maxChunkFactor, $factorTh $dbr->ping(); # Get the page row - $pageRes = $dbr->select( 'page', array('page_id', 'page_namespace', 'page_title'), + $pageRes = $dbr->select( 'page', + array('page_id', 'page_namespace', 'page_title','page_latest'), $pageConds + array('page_id' => $pageId), $fname ); if ( $dbr->numRows( $pageRes ) == 0 ) { continue; @@ -155,7 +157,13 @@ function compressWithConcat( $startId, $maxChunkSize, $maxChunkFactor, $factorTh # Load revisions $revRes = $dbw->select( $tables, $fields, - array( 'rev_page' => $pageRow->page_id ) + $conds, + array( + 'rev_page' => $pageRow->page_id, + # Don't operate on the current revision + # Use < instead of <> in case the current revision has changed + # since the page select, which wasn't locking + 'rev_id < ' . $pageRow->page_latest + ) + $conds, $fname, $revLoadOptions ); -- 2.20.1