From 52400140448b98b22b1429c9c141d982483f1c9a Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 6 Mar 2019 14:19:41 -0800 Subject: [PATCH] Do not bother with WAN cache set options for immutable text blob keys Doing so can only result in occasional needless set() call rejections or automatically lowered TTLs. Change-Id: I2f007ba88e8f9c9f1ac3cd3d2daf3cd2289e315a --- includes/Storage/SqlBlobStore.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/includes/Storage/SqlBlobStore.php b/includes/Storage/SqlBlobStore.php index d7216c5c72..a5c5985212 100644 --- a/includes/Storage/SqlBlobStore.php +++ b/includes/Storage/SqlBlobStore.php @@ -35,7 +35,6 @@ use Language; use MWException; use WANObjectCache; use Wikimedia\Assert\Assert; -use Wikimedia\Rdbms\Database; use Wikimedia\Rdbms\IDatabase; use Wikimedia\Rdbms\LoadBalancer; @@ -275,9 +274,7 @@ class SqlBlobStore implements IDBAccessObject, BlobStore { $this->getCacheKey( $blobAddress ), $this->getCacheTTL(), function ( $unused, &$ttl, &$setOpts ) use ( $blobAddress, $queryFlags ) { - list( $index ) = DBAccessObjectUtils::getDBOptions( $queryFlags ); - $setOpts += Database::getCacheSetOptions( $this->getDBConnection( $index ) ); - + // Ignore $setOpts; blobs are immutable and negatives are not cached return $this->fetchBlob( $blobAddress, $queryFlags ); }, [ 'pcGroup' => self::TEXT_CACHE_GROUP, 'pcTTL' => IExpiringStore::TTL_PROC_LONG ] @@ -417,7 +414,7 @@ class SqlBlobStore implements IDBAccessObject, BlobStore { $this->getCacheKey( $cacheKey ), $this->getCacheTTL(), function () use ( $url, $flags ) { - // No negative caching per BlobStore::getBlob() + // Ignore $setOpts; blobs are immutable and negatives are not cached $blob = ExternalStore::fetchFromURL( $url, [ 'wiki' => $this->wikiId ] ); return $blob === false ? false : $this->decompressData( $blob, $flags ); -- 2.20.1