r69745 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69744‎ | r69745 | r69746 >
Date:19:42, 22 July 2010
Author:peter17
Status:ok (Comments)
Tags:
Comment:
Trying to solve a possible issue in caching foreign revision (described in r69723); NB: not sure at all my fix is correct...
Modified paths:
  • /branches/iwtransclusion/phase3/includes/Revision.php (modified) (history)

Diff [purge]

Index: branches/iwtransclusion/phase3/includes/Revision.php
@@ -905,7 +905,11 @@
906906 // Caching may be beneficial for massive use of external storage
907907 global $wgRevisionCacheExpiry, $wgMemc;
908908 $textId = $this->getTextId();
909 - $key = wfMemcKey( 'revisiontext', 'textid', $textId );
 909+ if( isset( $this->mWikiID ) ) {
 910+ $key = wfForeignMemcKey( $this->mWikiID, 'revisiontext', 'textid', $textId );
 911+ } else {
 912+ $key = wfMemcKey( 'revisiontext', 'textid', $textId );
 913+ }
910914 if( $wgRevisionCacheExpiry ) {
911915 $text = $wgMemc->get( $key );
912916 if( is_string( $text ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r87106Merge r69745, r69746, r69781, r69783reedy00:28, 29 April 2011
r92987Merge r87106 which is a Merge r69745, r69746, r69781, r69783reedy17:25, 24 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r69723iwtransclusion code moved from Parser.php to Interwiki.php; now able to retri...peter1709:48, 22 July 2010

Comments

#Comment by Catrope (talk | contribs)   20:09, 22 July 2010

Well the thing is that wfForeignMemcKey() doesn't exist yet, you have to write it :D . I'm sorry if I didn't make that clear before.

#Comment by Peter17 (talk | contribs)   20:15, 22 July 2010

Hum... there is actually a wfForeignMemcKey() in GlobalFunctions. Can you please explain more precisely what my wfForeignMemcKey is supposed to do (if different from the existing one)?

#Comment by Catrope (talk | contribs)   20:20, 22 July 2010

I had no idea it existed already, so I proposed a function name and parameter list identical to the existing one's. That's scary.

Status & tagging log