Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/231213
Change subject: MessageCache: derive the hash from the cache contents
......................................................................
MessageCache: derive the hash from the cache contents
Follow-up for I020617d, where I got this wrong. It is probable that multiple
application servers will try to build a local cache at the same time, in which
case they will cause the cache key to thrash. It is necessary that two
application servers building a local cache from the database generate the same
hash for a given set of messages.
Change-Id: Ieeefc2094a83be9401c466bec859c1588ddfbcdf
---
M includes/cache/MessageCache.php
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/13/231213/1
diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php
index 8fe0bf9..c0e180d 100644
--- a/includes/cache/MessageCache.php
+++ b/includes/cache/MessageCache.php
@@ -523,7 +523,8 @@
}
$cache['VERSION'] = MSG_CACHE_VERSION;
- $cache['HASH'] = wfRandomString( 8 );
+ ksort( $cache );
+ $cache['HASH'] = md5( FormatJson::encode( $cache, false,
FormatJson::ALL_OK ) );
$cache['EXPIRY'] = wfTimestamp( TS_MW, time() + $this->mExpiry
);
return $cache;
--
To view, visit https://gerrit.wikimedia.org/r/231213
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieeefc2094a83be9401c466bec859c1588ddfbcdf
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