From 2e90693ca7b86ddb253c20de5e70c11cd90e188a Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 18 Dec 2017 12:35:52 -0800 Subject: [PATCH] Use cache set options in SqlBlobStore::getBlob This is useful for sanity in the case of DB rollback. Change-Id: I2e50183835a97bc82efee53a407a624f0e35f53f --- includes/Storage/SqlBlobStore.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 ] -- 2.20.1