mirror of https://github.com/apache/lucene.git
SOLR-12392: Don't create conflicting ops when docs / index size criteria conflict.
This commit is contained in:
parent
d9da757bc5
commit
87d9343a9b
|
@ -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)) {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue