Catrope has uploaded a new change for review.

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

Change subject: Fix non-deterministic behavior in FeatureIndex
......................................................................

Fix non-deterministic behavior in FeatureIndex

Links could fail to be updated properly due to different key orders.

This was supposed to be taken into account by the sort, but
sort() has useless behavior when strings and numbers are mixed:

Instead, sort by the key.

$input = array( 'ref_src_wiki' => 'wiki', 'ref_src_namespace' => 191, 
'ref_src_title' => '2015-10-29_missing_link_retest' ); sort( $input ); echo 
wfForeignMemcKey( 'wiki', '', 'flow_ref:wiki:by-source:v3', md5( implode( ':', 
$input ) ), '4.7' )
$input = array( 'ref_src_namespace' => 191, 'ref_src_title' => 
'2015-10-29_missing_link_retest', 'ref_src_wiki' => 'wiki' ); sort( $input ); 
echo wfForeignMemcKey( 'wiki', '', 'flow_ref:wiki:by-source:v3', md5( implode( 
':', $input ) ), '4.7' )

This might have caused issues other places too.

scap to all branches simultaneously, along with
I9a8e7832ac43292c7dc0fffd88951610b748aa82

Bug: T117138
Change-Id: Id3cb1a3704752ca06fc09cefd463d3cc276c04e1
(cherry picked from commit 1e3b168b92c562a1c42eefe210db84d977f70bcf)
---
M Flow.php
M includes/Data/Index/FeatureIndex.php
2 files changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/Flow.php b/Flow.php
index fb58c03..1e8164a 100644
--- a/Flow.php
+++ b/Flow.php
@@ -347,7 +347,7 @@
 // A version string appended to cache keys. Bump this if cache format or logic 
changes.
 // Flow can be a cross-wiki database accessed by wikis running different 
versions of the
 // Flow code; WMF sometimes overrides this globally in 
wmf-config/CommonSettings.php
-$wgFlowCacheVersion = '4.7';
+$wgFlowCacheVersion = '4.8';
 
 // ElasticSearch servers
 $wgFlowSearchServers = array( 'localhost' );
diff --git a/includes/Data/Index/FeatureIndex.php 
b/includes/Data/Index/FeatureIndex.php
index 6eec95e..b628124 100644
--- a/includes/Data/Index/FeatureIndex.php
+++ b/includes/Data/Index/FeatureIndex.php
@@ -691,7 +691,7 @@
 
                // values in $attributes may not always be in the exact same 
order,
                // which would lead to differences in cache key if we don't 
force that
-               sort( $attributes );
+               ksort( $attributes );
 
                return wfForeignMemcKey( self::cachedDbId(), '', $this->prefix, 
md5( implode( ':', $attributes ) ), Container::get( 'cache.version' ) );
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id3cb1a3704752ca06fc09cefd463d3cc276c04e1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: wmf/1.27.0-wmf.4
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>

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

Reply via email to