From: Brion Vibber Date: Tue, 14 Mar 2006 00:47:58 +0000 (+0000) Subject: Fixed bogus fallback to master in external storage. X-Git-Tag: 1.6.0~209 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=4d0d2e56e5aa976df6638e477c5ad81e1b773b28;p=lhc%2Fweb%2Fwiklou.git Fixed bogus fallback to master in external storage. It was loading a second time from the slave, *and* the logging code had a typo so didn't show it. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 04c2d86d50..ed8e0c7380 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -683,6 +683,7 @@ fully support the editing toolbar, but was found to be too confusing. * (bug 5161) Don't try to load template list for nonexistent pages * (bug 5228) Workaround for broken LanguageConverter title overrides; avoid unnecessary hidden UI work when watch/unwatch is performed on edit +* Fixed bogus master fallback in external storage === Caveats === diff --git a/includes/ExternalStoreDB.php b/includes/ExternalStoreDB.php index beb4041a06..7c3184056a 100644 --- a/includes/ExternalStoreDB.php +++ b/includes/ExternalStoreDB.php @@ -105,9 +105,13 @@ class ExternalStoreDB { $dbr =& $this->getSlave( $cluster ); $ret = $dbr->selectField( $this->getTable( $dbr ), 'blob_text', array( 'blob_id' => $id ) ); if ( $ret === false ) { + wfDebugLog( 'ExternalStoreDB', "ExternalStoreDB::fetchBlob master fallback on $cacheID\n" ); // Try the master $dbw =& $this->getMaster( $cluster ); - $ret = $dbr->selectField( $this->getTable( $dbr ), 'blob_text', array( 'blob_id' => $id ) ); + $ret = $dbw->selectField( $this->getTable( $dbw ), 'blob_text', array( 'blob_id' => $id ) ); + if( $ret === false) { + wfDebugLog( 'ExternalStoreDB', "ExternalStoreDB::fetchBlob master failed to find $cacheID\n" ); + } } if( $itemID !== false && $ret !== false ) { // Unserialise object; caller extracts item