Sbisson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/249003

Change subject: Fix cache key construction
......................................................................

Fix cache key construction

Since I83ea7e7336a1c9e64aa42284c2517089a736efe5,
wfForeignMemcKey( 'a', 'b' ) !== wfForeignMemcKey( 'a:b' )

Changing the way we generate some of the keys
so we read and write with the exact same keys.

Bug: T116582
Change-Id: I0bd52182d771e5cc25aec77428f704a0d102d41f
---
M includes/Repository/MultiGetList.php
M includes/Repository/TreeRepository.php
2 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/03/249003/1

diff --git a/includes/Repository/MultiGetList.php 
b/includes/Repository/MultiGetList.php
index 7cfca54..090fa24 100644
--- a/includes/Repository/MultiGetList.php
+++ b/includes/Repository/MultiGetList.php
@@ -28,8 +28,8 @@
         * @return array
         * @throws InvalidInputException
         */
-       public function get( $key, array $ids, $loadCallback ) {
-               $key = implode( ':', (array) $key );
+       public function get( $type, array $ids, $loadCallback ) {
+//             $key = implode( ':', (array) $key );
                $cacheKeys = array();
                foreach ( $ids as $id ) {
                        if ( $id instanceof UUID ) {
@@ -40,7 +40,7 @@
                        } else {
                                $cacheId = $id;
                        }
-                       $cacheKeys[wfForeignMemcKey( 'flow', '', $key, 
$cacheId, Container::get( 'cache.version' ) )] = $id;
+                       $cacheKeys[wfForeignMemcKey( 'flow', '', 'tree', $type, 
$cacheId, Container::get( 'cache.version' ) )] = $id;
                }
                return $this->getByKey( $cacheKeys, $loadCallback );
        }
diff --git a/includes/Repository/TreeRepository.php 
b/includes/Repository/TreeRepository.php
index ee262a1..651a094 100644
--- a/includes/Repository/TreeRepository.php
+++ b/includes/Repository/TreeRepository.php
@@ -394,7 +394,7 @@
        public function fetchSubtreeNodeList( array $roots ) {
                $list = new MultiGetList( $this->cache );
                $res = $list->get(
-                       array( 'tree', 'subtree' ),
+                       'subtree',
                        $roots,
                        array( $this, 'fetchSubtreeNodeListFromDb' )
                );
@@ -443,7 +443,7 @@
        public function fetchParentMap( array $nodes ) {
                $list = new MultiGetList( $this->cache );
                return $list->get(
-                       array( 'tree', 'parent' ),
+                       'parent',
                        $nodes,
                        array( $this, 'fetchParentMapFromDb' )
                );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bd52182d771e5cc25aec77428f704a0d102d41f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Sbisson <sbis...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to