Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/273594
Change subject: Fix-up for Iec1504700a
......................................................................
Fix-up for Iec1504700a
Make sure the in-process cache is updated / deleted whenever the WAN cache is
updated / deleted.
Change-Id: Idef9a9d3d65b947a595966edd7c889203770e049
---
M includes/user/User.php
1 file changed, 10 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/94/273594/1
diff --git a/includes/user/User.php b/includes/user/User.php
index c92c06b..872c254 100644
--- a/includes/user/User.php
+++ b/includes/user/User.php
@@ -443,7 +443,10 @@
*/
public static function purge( $wikiId, $userId ) {
$cache = ObjectCache::getMainWANInstance();
- $cache->delete( $cache->makeGlobalKey( 'user', 'id', $wikiId,
$userId ) );
+ $processCache = ObjectCache::getLocalServerInstance( 'hash' );
+ $key = $cache->makeGlobalKey( 'user', 'id', $wikiId, $userId );
+ $cache->delete( $key );
+ $processCache->delete( $key );
}
/**
@@ -513,8 +516,10 @@
$opts = Database::getCacheSetOptions( wfGetDB( DB_SLAVE ) );
$cache = ObjectCache::getMainWANInstance();
+ $processCache = ObjectCache::getLocalServerInstance( 'hash' );
$key = $this->getCacheKey( $cache );
$cache->set( $key, $data, $cache::TTL_HOUR, $opts );
+ $processCache->set( $key, $data );
}
/** @name newFrom*() static factory methods */
@@ -2302,12 +2307,15 @@
}
$cache = ObjectCache::getMainWANInstance();
+ $processCache = ObjectCache::getLocalServerInstance( 'hash' );
$key = $this->getCacheKey( $cache );
if ( $mode === 'refresh' ) {
$cache->delete( $key, 1 );
+ $processCache->delete( $key );
} else {
- wfGetDB( DB_MASTER )->onTransactionPreCommitOrIdle(
function() use ( $cache, $key ) {
+ wfGetDB( DB_MASTER )->onTransactionPreCommitOrIdle(
function() use ( $cache, $processCache, $key ) {
$cache->delete( $key );
+ $processCache->delete( $key );
} );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/273594
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idef9a9d3d65b947a595966edd7c889203770e049
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits