Aaron Schulz has submitted this change and it was merged.

Change subject: Fixed long memcached keys for infoaction.
......................................................................


Fixed long memcached keys for infoaction.

* One place was already using SHA1, so invalidation was broken.

Change-Id: Ie0d3b9274ed2e1c5a7b1616cd237a5e25fd99d12
---
M includes/actions/InfoAction.php
1 file changed, 6 insertions(+), 4 deletions(-)

Approvals:
  Aaron Schulz: Verified
  Reedy: Looks good to me, approved



diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php
index 7cd1f72..e3ea6fc 100644
--- a/includes/actions/InfoAction.php
+++ b/includes/actions/InfoAction.php
@@ -66,8 +66,8 @@
                // Clear page info.
                $revision = WikiPage::factory( $title )->getRevision();
                if ( $revision !== null ) {
-                       $memcKey = wfMemcKey( 'infoaction', 
$title->getPrefixedText(), $revision->getId() );
-                       $wgMemc->delete( $memcKey );
+                       $key = wfMemcKey( 'infoaction', sha1( 
$title->getPrefixedText() ), $revision->getId() );
+                       $wgMemc->delete( $key );
                }
        }
 
@@ -185,14 +185,16 @@
         * @return array
         */
        protected function pageInfo() {
-               global $wgContLang, $wgRCMaxAge, $wgMemc, 
$wgUnwatchedPageThreshold, $wgPageInfoTransclusionLimit;
+               global $wgContLang, $wgRCMaxAge, $wgMemc,
+                       $wgUnwatchedPageThreshold, $wgPageInfoTransclusionLimit;
 
                $user = $this->getUser();
                $lang = $this->getLanguage();
                $title = $this->getTitle();
                $id = $title->getArticleID();
 
-               $memcKey = wfMemcKey( 'infoaction', sha1( 
$title->getPrefixedText() ), $this->page->getLatest() );
+               $memcKey = wfMemcKey( 'infoaction',
+                       sha1( $title->getPrefixedText() ), 
$this->page->getLatest() );
                $pageCounts = $wgMemc->get( $memcKey );
                if ( $pageCounts === false ) {
                        // Get page information that would be too "expensive" 
to retrieve by normal means

-- 
To view, visit https://gerrit.wikimedia.org/r/67319
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie0d3b9274ed2e1c5a7b1616cd237a5e25fd99d12
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Daniel Friesen <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to