Fixed bogus fallback to master in external storage.
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 14 Mar 2006 00:47:58 +0000 (00:47 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 14 Mar 2006 00:47:58 +0000 (00:47 +0000)
It was loading a second time from the slave, *and* the logging code had a typo so didn't show it.

RELEASE-NOTES
includes/ExternalStoreDB.php

index 04c2d86..ed8e0c7 100644 (file)
@@ -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 ===
index beb4041..7c31840 100644 (file)
@@ -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