lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject lucene-solr:master: SOLR-12392: Don't create conflicting ops when docs / index size criteria conflict.
Date Tue, 12 Jun 2018 08:43:19 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master d9da757bc -> 87d9343a9


SOLR-12392: Don't create conflicting ops when docs / index size criteria conflict.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/87d9343a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/87d9343a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/87d9343a

Branch: refs/heads/master
Commit: 87d9343a9bc3304bf6ad07ba13f24c50c7591811
Parents: d9da757
Author: Andrzej Bialecki <ab@apache.org>
Authored: Mon Jun 11 19:41:47 2018 +0200
Committer: Andrzej Bialecki <ab@apache.org>
Committed: Tue Jun 12 10:43:13 2018 +0200

----------------------------------------------------------------------
 .../org/apache/solr/cloud/autoscaling/IndexSizeTrigger.java | 9 +++++++--
 .../apache/solr/cloud/autoscaling/IndexSizeTriggerTest.java | 7 +++----
 2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/87d9343a/solr/core/src/java/org/apache/solr/cloud/autoscaling/IndexSizeTrigger.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/autoscaling/IndexSizeTrigger.java b/solr/core/src/java/org/apache/solr/cloud/autoscaling/IndexSizeTrigger.java
index 9460fc7..f729864 100644
--- a/solr/core/src/java/org/apache/solr/cloud/autoscaling/IndexSizeTrigger.java
+++ b/solr/core/src/java/org/apache/solr/cloud/autoscaling/IndexSizeTrigger.java
@@ -289,6 +289,8 @@ public class IndexSizeTrigger extends TriggerBase {
     // collection / list(info)
     Map<String, List<ReplicaInfo>> aboveSize = new HashMap<>();
 
+    Set<String> splittable = new HashSet<>();
+
     currentSizes.forEach((coreName, info) -> {
       if ((Long)info.getVariable(BYTES_SIZE_PROP) > aboveBytes ||
           (Long)info.getVariable(DOCS_SIZE_PROP) > aboveDocs) {
@@ -301,6 +303,7 @@ public class IndexSizeTrigger extends TriggerBase {
               info.getVariables().put(VIOLATION_PROP, ABOVE_DOCS_PROP);
             }
             infos.add(info);
+            splittable.add(info.getName());
           }
         }
       } else {
@@ -313,8 +316,10 @@ public class IndexSizeTrigger extends TriggerBase {
     Map<String, List<ReplicaInfo>> belowSize = new HashMap<>();
 
     currentSizes.forEach((coreName, info) -> {
-      if ((Long)info.getVariable(BYTES_SIZE_PROP) < belowBytes ||
-          (Long)info.getVariable(DOCS_SIZE_PROP) < belowDocs) {
+      if (((Long)info.getVariable(BYTES_SIZE_PROP) < belowBytes ||
+          (Long)info.getVariable(DOCS_SIZE_PROP) < belowDocs) &&
+          // make sure we don't produce conflicting ops
+          !splittable.contains(info.getName())) {
         if (waitForElapsed(coreName, now, lastBelowEventMap)) {
           List<ReplicaInfo> infos = belowSize.computeIfAbsent(info.getCollection(),
c -> new ArrayList<>());
           if (!infos.contains(info)) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/87d9343a/solr/core/src/test/org/apache/solr/cloud/autoscaling/IndexSizeTriggerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/IndexSizeTriggerTest.java
b/solr/core/src/test/org/apache/solr/cloud/autoscaling/IndexSizeTriggerTest.java
index 8d3a1bd..a62048a 100644
--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/IndexSizeTriggerTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/IndexSizeTriggerTest.java
@@ -30,7 +30,6 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
 
-import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.TestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrRequest;
@@ -94,7 +93,7 @@ public class IndexSizeTriggerTest extends SolrCloudTestCase {
     configureCluster(2)
         .addConfig("conf", configset("cloud-minimal"))
         .configure();
-    if (random().nextBoolean()) {
+    if (random().nextBoolean() && false) {
       cloudManager = cluster.getJettySolrRunner(0).getCoreContainer().getZkController().getSolrCloudManager();
       solrClient = cluster.getSolrClient();
       loader = cluster.getJettySolrRunner(0).getCoreContainer().getResourceLoader();
@@ -236,7 +235,7 @@ public class IndexSizeTriggerTest extends SolrCloudTestCase {
   }
 
   @Test
-  @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12392")
+  //@LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12392")
   public void testSplitIntegration() throws Exception {
     String collectionName = "testSplitIntegration_collection";
     CollectionAdminRequest.Create create = CollectionAdminRequest.createCollection(collectionName,
@@ -349,7 +348,7 @@ public class IndexSizeTriggerTest extends SolrCloudTestCase {
   }
 
   @Test
-  @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12392")
+  //@LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12392")
   public void testMergeIntegration() throws Exception {
     String collectionName = "testMergeIntegration_collection";
     CollectionAdminRequest.Create create = CollectionAdminRequest.createCollection(collectionName,


Mime
View raw message