From 4d0d2e56e5aa976df6638e477c5ad81e1b773b28 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 14 Mar 2006 00:47:58 +0000 Subject: [PATCH] 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. --- RELEASE-NOTES | 1 + includes/ExternalStoreDB.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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 -- 2.20.1