From: Brion Vibber Date: Tue, 31 May 2005 07:21:31 +0000 (+0000) Subject: * Remove linkscc table code, no longer used. X-Git-Tag: 1.5.0alpha2~27 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=cb45389b9c4d5ec23b9d2e9848d94a46b6bbeca2;p=lhc%2Fweb%2Fwiklou.git * Remove linkscc table code, no longer used. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index fd39faa73f..bfe233f519 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -224,6 +224,7 @@ Various bugfixes, small features, and a few experimental things: * (bug 2262) Hide math preferences when TeX is not enabled * (bug 2267) Don't generate thumbnail at the same size as the source image. * Fix rebuildtextindex.inc for new schema +* Remove linkscc table code, no longer used. === Caveats === diff --git a/config/index.php b/config/index.php index 1a94942af8..8d9223e30a 100644 --- a/config/index.php +++ b/config/index.php @@ -1099,7 +1099,7 @@ if ( \$wgCommandLineMode ) { \$wgDBprefix = \"{$slconf['DBprefix']}\"; # If you're on MySQL 3.x, this next line must be FALSE: -\$wgDBmysql4 = \$wgEnablePersistentLC = {$conf->DBmysql4}; +\$wgDBmysql4 = {$conf->DBmysql4}; ## Shared memory settings \$wgMainCacheType = $cacheType; diff --git a/includes/Article.php b/includes/Article.php index e22da0be4c..d4f438405e 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2222,18 +2222,17 @@ class Article { $u = new SquidUpdate( $urls ); array_push( $wgPostCommitUpdateList, $u ); } - - # Clear persistent link cache - LinkCache::linksccClearLinksTo( $title_obj ); } function onArticleDelete($title_obj) { $title_obj->touchLinks(); - LinkCache::linksccClearLinksTo( $title_obj ); } + function onArticleEdit($title_obj) { - LinkCache::linksccClearPage( $title_obj->getArticleID() ); + // This would be an appropriate place to purge caches. + // Why's this not in here now? } + /**#@-*/ /** diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 508747d5b6..14e5c177ba 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -616,10 +616,6 @@ $wgUseCategoryMagic = true; */ $wgUseCategoryBrowser = false; -$wgEnablePersistentLC = false; # Obsolete, do not use -$wgCompressedPersistentLC = true; # use gzcompressed blobs -$wgUseOldExistenceCheck = false; # use old prefill link method, for debugging only - /** * Keep parsed pages in a cache (objectcache table, turck, or memcached) * to speed up output of the same page viewed by another user with the diff --git a/includes/LinkCache.php b/includes/LinkCache.php index 66545eaeb5..ef275ca7a1 100644 --- a/includes/LinkCache.php +++ b/includes/LinkCache.php @@ -181,8 +181,6 @@ class LinkCache { * @param Title $fromtitle */ function preFill( &$fromtitle ) { - global $wgEnablePersistentLC; - $fname = 'LinkCache::preFill'; wfProfileIn( $fname ); @@ -196,12 +194,6 @@ class LinkCache { return; } - if ( $wgEnablePersistentLC ) { - if( $this->fillFromLinkscc( $id ) ){ - wfProfileOut( $fname ); - return; - } - } if ( $this->mForUpdate ) { $db =& wfGetDB( DB_MASTER ); $options = 'FOR UPDATE'; @@ -229,9 +221,6 @@ class LinkCache { } $this->mPreFilled = true; - if ( $wgEnablePersistentLC ) { - $this->saveToLinkscc( $id ); - } wfProfileOut( $fname ); } @@ -334,95 +323,6 @@ class LinkCache { $this->mOldPageLinks = array(); } - /** - * @access private - */ - function fillFromLinkscc( $id ){ - $fname = 'LinkCache::fillFromLinkscc'; - - $id = IntVal( $id ); - if ( $this->mForUpdate ) { - $db =& wfGetDB( DB_MASTER ); - $options = 'FOR UPDATE'; - } else { - $db =& wfGetDB( DB_SLAVE ); - $options = ''; - } - $raw = $db->selectField( 'linkscc', 'lcc_cacheobj', array( 'lcc_pageid' => $id ), $fname, $options ); - if ( $raw === false ) { - return false; - } - - $cacheobj = false; - if( function_exists( 'gzuncompress' ) ) - $cacheobj = @gzuncompress( $raw ); - - if($cacheobj == FALSE){ - $cacheobj = $raw; - } - $cc = @unserialize( $cacheobj ); - if( isset( $cc->mClassVer ) and ($cc->mClassVer == $this->mClassVer ) ){ - $this->mOldPageLinks = $this->mPageLinks = $cc->mPageLinks; - $this->mOldGoodLinks = $this->mGoodLinks = $cc->mGoodLinks; - $this->mOldBadLinks = $this->mBadLinks = $cc->mBadLinks; - $this->mPreFilled = true; - return TRUE; - } else { - return FALSE; - } - - } - - /** - * @access private - */ - function saveToLinkscc( $pid ){ - global $wgCompressedPersistentLC; - if( $wgCompressedPersistentLC and function_exists( 'gzcompress' ) ) { - $ser = gzcompress( serialize( $this ), 3 ); - } else { - $ser = serialize( $this ); - } - $db =& wfGetDB( DB_MASTER ); - $db->replace( 'linkscc', array( 'lcc_pageid' ), array( 'lcc_pageid' => $pid, 'lcc_cacheobj' => $ser ) ); - } - - /** - * Delete linkscc rows which link to here - * @param $title The page linked to - * @static - */ - function linksccClearLinksTo( $title ){ - global $wgEnablePersistentLC; - if ( $wgEnablePersistentLC ) { - $fname = 'LinkCache::linksccClearLinksTo'; - $pid = intval( $pid ); - $dbw =& wfGetDB( DB_MASTER ); - # Delete linkscc rows which link to here - $dbw->deleteJoin( 'linkscc', 'pagelinks', 'lcc_pageid', 'pl_from', - array( - 'pl_namespace' => $title->getNamespace(), - 'pl-title' => $title->getDbKey() ), - $fname ); - # Delete linkscc row representing this page - $dbw->delete( 'linkscc', array( 'lcc_pageid' => $pid ), $fname); - } - - } - - /** - * @param $pid is a page id - * @static - */ - function linksccClearPage( $pid ){ - global $wgEnablePersistentLC; - if ( $wgEnablePersistentLC ) { - $pid = intval( $pid ); - $dbw =& wfGetDB( DB_MASTER ); - $dbw->delete( 'linkscc', array( 'lcc_pageid' => $pid ) ); - } - } - /** * Swaps old and current link registers */ diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index 506402e407..b0fac3646d 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -34,7 +34,7 @@ class LinksUpdate { function doUpdate() { global $wgUseDumbLinkUpdate, $wgLinkCache, $wgDBtransactions; - global $wgEnablePersistentLC, $wgUseCategoryMagic; + global $wgUseCategoryMagic; if ( $wgUseDumbLinkUpdate ) { $this->doDumbUpdate(); diff --git a/includes/Setup.php b/includes/Setup.php index a9969ddedf..e098396665 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -97,11 +97,6 @@ if ( $wgCommandLineMode ) { wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "\n" ); } -# Disable linkscc except if the old existence check method is enabled -if (!$wgUseOldExistenceCheck) { - $wgEnablePersistentLC = false; -} - if ( $wgSkipSkin ) { $wgSkipSkins[] = $wgSkipSkin; } diff --git a/includes/Title.php b/includes/Title.php index af25e70bad..d2b47e0b0c 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1652,10 +1652,6 @@ class Title { 'pl_title' => $this->getDbKey() ), $fname ); - # Clear linkscc - LinkCache::linksccClearLinksTo( $this ); - LinkCache::linksccClearLinksTo( $nt ); - # Purge squid if ( $wgUseSquid ) { $urls = array_merge( $nt->getSquidURLs(), $this->getSquidURLs() ); @@ -1722,7 +1718,7 @@ class Title { $log = new LogPage( 'move' ); $log->addEntry( 'move', $this, $reason, array( 1 => $nt->getPrefixedText()) ); - # Purge squid and linkscc as per article creation + # Purge caches as per article creation Article::onArticleCreate( $nt ); # Record the just-created redirect's linking to the page diff --git a/maintenance/convertUtf8.php b/maintenance/convertUtf8.php index 14096cf151..309784b400 100644 --- a/maintenance/convertUtf8.php +++ b/maintenance/convertUtf8.php @@ -130,13 +130,12 @@ class UtfUpdater { */ function updateAll() { $this->lockTables( array( - 'linkscc', 'objectcache', 'searchindex', 'querycache', + 'objectcache', 'searchindex', 'querycache', 'ipblocks', 'user', 'page', 'revision', 'recentchanges', 'brokenlinks', 'categorylinks', 'imagelinks', 'watchlist', 'image', 'oldimage', 'archive' ) ); # These are safe to clear out: - $this->clearTable( 'linkscc' ); $this->clearTable( 'objectcache' ); # These need to be rebuild if used: diff --git a/maintenance/parserTests.php b/maintenance/parserTests.php index 1205090271..e18cb72a68 100644 --- a/maintenance/parserTests.php +++ b/maintenance/parserTests.php @@ -30,6 +30,7 @@ $optionsWithArgs = array( 'regex' ); require_once( 'commandLine.inc' ); require_once( "$IP/includes/ObjectCache.php" ); +require_once( "$IP/includes/BagOStuff.php" ); require_once( "$IP/languages/LanguageUtf8.php" ); /** @@ -321,7 +322,7 @@ class ParserTest { function listTables() { return array('user', 'page', 'revision', 'text', 'pagelinks', 'imagelinks', 'categorylinks', - 'linkscc', 'site_stats', 'hitcounter', + 'site_stats', 'hitcounter', 'ipblocks', 'image', 'oldimage', 'recentchanges', 'watchlist', 'math', 'searchindex', diff --git a/maintenance/refreshLinks.inc b/maintenance/refreshLinks.inc index b7e1a23420..7eb6c60e21 100644 --- a/maintenance/refreshLinks.inc +++ b/maintenance/refreshLinks.inc @@ -10,7 +10,7 @@ define( "REPORTING_INTERVAL", 50 ); define( "PAUSE_INTERVAL", 50 ); function refreshLinks( $start ) { - global $wgUser, $wgTitle, $wgArticle, $wgEnablePersistentLC, $wgLinkCache, $wgOut; + global $wgUser, $wgTitle, $wgArticle, $wgLinkCache, $wgOut; $dbw =& wfGetDB( DB_MASTER ); @@ -59,10 +59,6 @@ function refreshLinks( $start ) { $wgOut->transformBuffer( RLH_FOR_UPDATE ); $wgOut->clearHTML(); - if ( $wgEnablePersistentLC ) { - $wgLinkCache->saveToLinkscc( $id, $dbw->strencode( $wgTitle->getPrefixedDBkey() ) ); - } - $linksUpdate = new LinksUpdate( $id, $wgTitle->getPrefixedDBkey() ); $linksUpdate->doDumbUpdate(); $dbw->query("COMMIT"); diff --git a/maintenance/tables.sql b/maintenance/tables.sql index 8b73be61e1..2bf8de4939 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -404,17 +404,6 @@ CREATE TABLE /*$wgDBprefix*/categorylinks ( ) TYPE=InnoDB; --- --- Stores (possibly gzipped) serialized objects with --- cache arrays to reduce database load slurping up --- from links and brokenlinks. --- -CREATE TABLE /*$wgDBprefix*/linkscc ( - lcc_pageid INT UNSIGNED NOT NULL UNIQUE KEY, - lcc_cacheobj MEDIUMBLOB NOT NULL - -) TYPE=InnoDB; - -- -- Contains a single row with some aggregate info -- on the state of the site. diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index c319c9c348..e2255c740f 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -16,7 +16,6 @@ $wgRenamedTables = array( $wgNewTables = array( # table patch file (in maintenance/archives) - array( 'linkscc', 'patch-linkscc.sql' ), array( 'hitcounter', 'patch-hitcounter.sql' ), array( 'querycache', 'patch-querycache.sql' ), array( 'objectcache', 'patch-objectcache.sql' ), @@ -156,19 +155,6 @@ function do_index_update() { return false; } -function do_linkscc_1_3_update() { - // Update linkscc table to 1.3 schema if necessary - global $wgDatabase, $wgVersion; - if( $wgDatabase->tableExists( "linkscc" ) - && $wgDatabase->fieldExists( "linkscc", "lcc_title" ) ) { - echo "Altering lcc_title field from linkscc table... "; - dbsource( "maintenance/archives/patch-linkscc-1.3.sql", $wgDatabase ); - echo "ok\n"; - } else { - echo "...linkscc is up to date, or does not exist. Good.\n"; - } -} - function do_image_name_unique_update() { global $wgDatabase; if( $wgDatabase->indexExists( 'image', 'PRIMARY' ) ) { @@ -596,7 +582,6 @@ function do_all_updates() { # Do schema updates which require special handling do_interwiki_update(); flush(); do_index_update(); flush(); - do_linkscc_1_3_update(); flush(); do_old_links_update(); flush(); do_image_name_unique_update(); flush(); do_watchlist_update(); flush();