You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by tf...@apache.org on 2020/05/16 21:44:31 UTC

[lucene-solr] branch branch_8_5 updated (14c6a5b -> 384dadd)

This is an automated email from the ASF dual-hosted git repository.

tflobbe pushed a change to branch branch_8_5
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git.


    from 14c6a5b  Add 7.7.3 bugfix version
     new 6677d5f  SOLR-14471: Fix last-place replica after shards.preference rules  (#1507)
     new 384dadd  SOLR-14471: CHANGES entry for 8.5.2

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 solr/CHANGES.txt                                        |  3 +++
 .../routing/RequestReplicaListTransformerGenerator.java |  3 ++-
 .../RequestReplicaListTransformerGeneratorTest.java     | 17 ++++++++++++++++-
 3 files changed, 21 insertions(+), 2 deletions(-)


[lucene-solr] 01/02: SOLR-14471: Fix last-place replica after shards.preference rules (#1507)

Posted by tf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tflobbe pushed a commit to branch branch_8_5
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 6677d5f1fd0ee63dc7f681e770923e74081f176c
Author: Michael Gibney <mi...@michaelgibney.net>
AuthorDate: Fri May 15 00:31:35 2020 -0400

    SOLR-14471: Fix last-place replica after shards.preference rules  (#1507)
    
    Properly apply base replica ordering to last-place shards.preference matches
---
 .../routing/RequestReplicaListTransformerGenerator.java |  3 ++-
 .../RequestReplicaListTransformerGeneratorTest.java     | 17 ++++++++++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGenerator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGenerator.java
index 12ce4cf..d3e0073 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGenerator.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGenerator.java
@@ -158,7 +158,7 @@ public class RequestReplicaListTransformerGenerator {
         Object current;
         int idx = 1;
         int boundaryCount = 0;
-        int[] boundaries = new int[choices.size() - 1];
+        int[] boundaries = new int[choices.size()];
         do {
           current = iter.next();
           if (replicaComp.compare(prev, current) != 0) {
@@ -167,6 +167,7 @@ public class RequestReplicaListTransformerGenerator {
           prev = current;
           idx++;
         } while (iter.hasNext());
+        boundaries[boundaryCount++] = idx;
 
         // Finally inspect boundaries to apply base transformation, where necessary (separate phase to avoid ConcurrentModificationException)
         int startIdx = 0;
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGeneratorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGeneratorTest.java
index 5b64fde..c0ebad3 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGeneratorTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGeneratorTest.java
@@ -88,6 +88,19 @@ public class RequestReplicaListTransformerGeneratorTest extends SolrTestCaseJ4 {
         )
     );
 
+    // Add a PULL replica so that there's a tie for "last place"
+    replicas.add(
+        new Replica(
+            "node5",
+            map(
+                ZkStateReader.BASE_URL_PROP, "http://host2_2:8983/solr",
+                ZkStateReader.NODE_NAME_PROP, "node5",
+                ZkStateReader.CORE_NAME_PROP, "collection1",
+                ZkStateReader.REPLICA_TYPE, "PULL"
+            ), "c1","s1"
+        )
+    );
+
     // replicaType and replicaBase combined rule param
     String rulesParam = ShardParams.SHARDS_PREFERENCE_REPLICA_TYPE + ":NRT," +
         ShardParams.SHARDS_PREFERENCE_REPLICA_TYPE + ":TLOG," +
@@ -101,6 +114,7 @@ public class RequestReplicaListTransformerGeneratorTest extends SolrTestCaseJ4 {
     assertEquals("node2", replicas.get(1).getNodeName());
     assertEquals("node4", replicas.get(2).getNodeName());
     assertEquals("node3", replicas.get(3).getNodeName());
+    assertEquals("node5", replicas.get(4).getNodeName());
 
     params.set("routingPreference", "1");
     rlt = generator.getReplicaListTransformer(params);
@@ -108,7 +122,8 @@ public class RequestReplicaListTransformerGeneratorTest extends SolrTestCaseJ4 {
     assertEquals("node1", replicas.get(0).getNodeName());
     assertEquals("node4", replicas.get(1).getNodeName());
     assertEquals("node2", replicas.get(2).getNodeName());
-    assertEquals("node3", replicas.get(3).getNodeName());
+    assertEquals("node5", replicas.get(3).getNodeName());
+    assertEquals("node3", replicas.get(4).getNodeName());
   }
 
   @SuppressWarnings("unchecked")


[lucene-solr] 02/02: SOLR-14471: CHANGES entry for 8.5.2

Posted by tf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tflobbe pushed a commit to branch branch_8_5
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 384dadd9141cec3f848d8c416315dc2384749814
Author: Tomas Fernandez Lobbe <tf...@apache.org>
AuthorDate: Sat May 16 13:50:05 2020 -0700

    SOLR-14471: CHANGES entry for 8.5.2
---
 solr/CHANGES.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 7c2adfb..2b6a338 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -13,6 +13,9 @@ Bug Fixes
 
 * SOLR-14411: Fix Admin UI collection/core drop-downs placeholder text. Completes work started in SOLR-14359 (janhoy)
 
+* SOLR-14471: Fix bug in shards.preference behavior, base replica selection strategy not applied to the last group of
+  equivalent replicas. (Michael Gibney via Tomás Fernández Löbbe)
+
 ==================  8.5.1 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.