From: Aaron Schulz Date: Mon, 18 Dec 2017 20:35:52 +0000 (-0800) Subject: Use cache set options in SqlBlobStore::getBlob X-Git-Tag: 1.31.0-rc.0~910^2 X-Git-Url: http://git.cyclocoop.org/%27.generer_url_ecrire%28%27admin_couteau_suisse%27%2C%27cmd=descrip&outil=boites_privees?a=commitdiff_plain;h=2e90693ca7b86ddb253c20de5e70c11cd90e188a;p=lhc%2Fweb%2Fwiklou.git Use cache set options in SqlBlobStore::getBlob This is useful for sanity in the case of DB rollback. Change-Id: I2e50183835a97bc82efee53a407a624f0e35f53f --- diff --git a/includes/Storage/SqlBlobStore.php b/includes/Storage/SqlBlobStore.php index 5ddbd34ccb..ec664318c3 100644 --- a/includes/Storage/SqlBlobStore.php +++ b/includes/Storage/SqlBlobStore.php @@ -35,6 +35,7 @@ use Language; use MWException; use WANObjectCache; use Wikimedia\Assert\Assert; +use Wikimedia\Rdbms\Database; use Wikimedia\Rdbms\IDatabase; use Wikimedia\Rdbms\LoadBalancer; @@ -269,7 +270,10 @@ class SqlBlobStore implements IDBAccessObject, BlobStore { // TODO: change key, since this is not necessarily revision text! $this->cache->makeKey( 'revisiontext', 'textid', $blobAddress ), $this->getCacheTTL(), - function () use ( $blobAddress, $queryFlags ) { + function ( $unused, &$ttl, &$setOpts ) use ( $blobAddress, $queryFlags ) { + list( $index ) = DBAccessObjectUtils::getDBOptions( $queryFlags ); + $setOpts += Database::getCacheSetOptions( $this->getDBConnection( $index ) ); + return $this->fetchBlob( $blobAddress, $queryFlags ); }, [ 'pcGroup' => self::TEXT_CACHE_GROUP, 'pcTTL' => IExpiringStore::TTL_PROC_LONG ]