Skip to content

Commit

Permalink
Merge branch 'main' into feature/segment-replication
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Handalian <[email protected]>
  • Loading branch information
mch2 committed Mar 22, 2022
2 parents c879f7d + fb76361 commit 3b57a13
Show file tree
Hide file tree
Showing 690 changed files with 4,814 additions and 2,905 deletions.
3 changes: 2 additions & 1 deletion .ci/bwcVersions
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ BWC_VERSION:
- "1.2.4"
- "1.2.5"
- "1.3.0"
- "1.4.0"
- "1.3.1"
- "1.4.0"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [Security](#security)
- [License](#license)
- [Copyright](#copyright)
- [Trademark](#trademark)

## Welcome!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public static DiscoveryNode newNode(String nodeId, Map<String, String> attribute
nodeId,
new TransportAddress(TransportAddress.META_ADDRESS, portGenerator.incrementAndGet()),
attributes,
Sets.newHashSet(DiscoveryNodeRole.MASTER_ROLE, DiscoveryNodeRole.DATA_ROLE),
Sets.newHashSet(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE, DiscoveryNodeRole.DATA_ROLE),
Version.CURRENT
);
}
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,19 @@ dependencies {
api 'com.netflix.nebula:gradle-info-plugin:7.1.3'
api 'org.apache.rat:apache-rat:0.13'
api 'commons-io:commons-io:2.7'
api "net.java.dev.jna:jna:5.5.0"
api "net.java.dev.jna:jna:5.10.0"
api 'gradle.plugin.com.github.johnrengelman:shadow:7.1.2'
api 'de.thetaphi:forbiddenapis:3.2'
api 'com.avast.gradle:gradle-docker-compose-plugin:0.14.12'
api 'org.apache.maven:maven-model:3.6.2'
api 'com.networknt:json-schema-validator:1.0.36'
api 'com.networknt:json-schema-validator:1.0.67'
api "com.fasterxml.jackson.core:jackson-databind:${props.getProperty('jackson')}"

testFixturesApi "junit:junit:${props.getProperty('junit')}"
testFixturesApi "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${props.getProperty('randomizedrunner')}"
testFixturesApi gradleApi()
testFixturesApi gradleTestKit()
testImplementation 'com.github.tomakehurst:wiremock-jre8-standalone:2.23.2'
testImplementation 'com.github.tomakehurst:wiremock-jre8-standalone:2.32.0'
testImplementation "org.mockito:mockito-core:${props.getProperty('mockito')}"
integTestImplementation('org.spockframework:spock-core:2.1-groovy-3.0') {
exclude module: "groovy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class PluginBuildPlugin implements Plugin<Project> {
naming.clear()
naming {
Tests {
baseClass 'org.apache.lucene.util.LuceneTestCase'
baseClass 'org.apache.lucene.tests.util.LuceneTestCase'
}
IT {
baseClass 'org.opensearch.test.OpenSearchIntegTestCase'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ class ClusterFormationTasks {
}
boolean supportsInitialMasterNodes = hasBwcNodes == false || config.bwcVersion.onOrAfter("7.0.0")
if (esConfig['discovery.type'] == null && config.getAutoSetInitialMasterNodes() && supportsInitialMasterNodes) {
esConfig['cluster.initial_master_nodes'] = nodes.stream().map({ n ->
// To promote inclusive language, the old setting name is deprecated in 2.0.0
esConfig[node.nodeVersion.onOrAfter("2.0.0") ? 'cluster.initial_cluster_manager_nodes' : 'cluster.initial_master_nodes'] = nodes.stream().map({ n ->
if (n.config.settings['node.name'] == null) {
return "node-" + n.nodeNum
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public TaskProvider<? extends Task> createTask(Project project) {
.register("testingConventions", TestingConventionsTasks.class);
testingConventions.configure(t -> {
TestingConventionRule testsRule = t.getNaming().maybeCreate("Tests");
testsRule.baseClass("org.apache.lucene.util.LuceneTestCase");
testsRule.baseClass("org.apache.lucene.tests.util.LuceneTestCase");
TestingConventionRule itRule = t.getNaming().maybeCreate("IT");
itRule.baseClass("org.opensearch.test.OpenSearchIntegTestCase");
itRule.baseClass("org.opensearch.test.rest.OpenSearchRestTestCase");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,12 @@ private void commonNodeConfig(OpenSearchNode node, String nodeNames, OpenSearchN
.collect(Collectors.toList())
.forEach(node.defaultConfig::remove);
if (nodeNames != null && node.settings.getOrDefault("discovery.type", "anything").equals("single-node") == false) {
node.defaultConfig.put("cluster.initial_master_nodes", "[" + nodeNames + "]");
// To promote inclusive language, the old setting name is deprecated n 2.0.0
if (node.getVersion().onOrAfter("2.0.0")) {
node.defaultConfig.put("cluster.initial_cluster_manager_nodes", "[" + nodeNames + "]");
} else {
node.defaultConfig.put("cluster.initial_master_nodes", "[" + nodeNames + "]");
}
}
node.defaultConfig.put("discovery.seed_providers", "file");
node.defaultConfig.put("discovery.seed_hosts", "[]");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ com.carrotsearch.randomizedtesting.annotations.Seed @ Don't commit hardcoded see
com.carrotsearch.randomizedtesting.annotations.Repeat @ Don't commit hardcoded repeats

org.apache.lucene.codecs.Codec#setDefault(org.apache.lucene.codecs.Codec) @ Use the SuppressCodecs("*") annotation instead
org.apache.lucene.util.LuceneTestCase$Slow @ Don't write slow tests
org.apache.lucene.tests.util.LuceneTestCase$Slow @ Don't write slow tests
org.junit.Ignore @ Use AwaitsFix instead
org.apache.lucene.util.LuceneTestCase$Nightly @ We don't run nightly tests at this point!
org.apache.lucene.tests.util.LuceneTestCase$Nightly @ We don't run nightly tests at this point!
com.carrotsearch.randomizedtesting.annotations.Nightly @ We don't run nightly tests at this point!

org.junit.Test @defaultMessage Just name your test method testFooBar
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/version.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opensearch = 2.0.0
lucene = 9.0.0
lucene = 9.1.0-snapshot-ea989fe8f30

bundled_jdk_vendor = adoptium
bundled_jdk = 17.0.2+8
Expand All @@ -9,9 +9,9 @@ bundled_jdk = 17.0.2+8
# optional dependencies
spatial4j = 0.7
jts = 1.15.0
jackson = 2.12.6
jackson = 2.13.2
snakeyaml = 1.26
icu4j = 68.2
icu4j = 70.1
supercsv = 2.4.0
log4j = 2.17.1
slf4j = 1.6.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import org.apache.http.client.methods.HttpHead;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.tests.util.LuceneTestCase;
import org.opensearch.action.ActionRequestValidationException;
import org.opensearch.action.admin.indices.alias.Alias;
import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest;
Expand Down
8 changes: 4 additions & 4 deletions client/rest/src/main/java/org/opensearch/client/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,21 +210,21 @@ public Roles(final Set<String> roles) {
}

/**
* Teturns whether or not the node <strong>could</strong> be elected master.
* Returns whether or not the node <strong>could</strong> be elected master.
*/
public boolean isMasterEligible() {
return roles.contains("master");
return roles.contains("master") || roles.contains("cluster_manager");
}

/**
* Teturns whether or not the node stores data.
* Returns whether or not the node stores data.
*/
public boolean isData() {
return roles.contains("data");
}

/**
* Teturns whether or not the node runs ingest pipelines.
* Returns whether or not the node runs ingest pipelines.
*/
public boolean isIngest() {
return roles.contains("ingest");
Expand Down
1 change: 0 additions & 1 deletion client/sniffer/licenses/jackson-core-2.12.6.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions client/sniffer/licenses/jackson-core-2.13.2.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0a6a0e0620d51833feffc67bccb51937b2345763
4 changes: 2 additions & 2 deletions distribution/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
image: opensearch:test
environment:
- node.name=opensearch-1
- cluster.initial_master_nodes=opensearch-1,opensearch-2
- cluster.initial_cluster_manager_nodes=opensearch-1,opensearch-2
- discovery.seed_hosts=opensearch-2:9300
- cluster.name=opensearch
- bootstrap.memory_lock=true
Expand All @@ -29,7 +29,7 @@ services:
image: opensearch:test
environment:
- node.name=opensearch-2
- cluster.initial_master_nodes=opensearch-1,opensearch-2
- cluster.initial_cluster_manager_nodes=opensearch-1,opensearch-2
- discovery.seed_hosts=opensearch-1:9300
- cluster.name=opensearch
- bootstrap.memory_lock=true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,40 @@
---
"Test cat nodes output - before 2.0.0":
- skip:
version: "2.0.0 - "
reason: "master is replaced by cluster_manager in 2.0.0"

- do:
cat.nodes:
v: true

- match:
$body: |
/^ ip \s+ heap\.percent \s+ ram\.percent \s+ cpu \s+ load_1m \s+ load_5m \s+ load_15m \s+ node\.role \s+ master \s+ name \n
((\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d* \s+ (-)?\d* \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ (-|[cdhilmrstvw]{1,11}) \s+ [-*x] \s+ (\S+\s?)+ \n)+ $/
---
"Test cat nodes output":
- skip:
version: " - 1.4.99"
reason: "cluster_manager is introduced in 2.0.0"

- do:
cat.nodes: {}

- match:
$body: |
/ #ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
^ ((\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d* \s+ (-)?\d* \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)?\s+ ((-)?\d*(\.\d+)?)? \s+ (-|[cdhilmrstvw]{1,11}) \s+ [-*x] \s+ (\S+\s?)+ \n)+ $/
/ #ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role cluster_manager name
^ ((\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d* \s+ (-)?\d* \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)?\s+ ((-)?\d*(\.\d+)?)? \s+ (-|[cdhilmrstvw]{1,11}) \s+ [-*x] \s+ (\S+\s?)+ \n)+ $/
- do:
cat.nodes:
v: true

- match:
$body: |
/^ ip \s+ heap\.percent \s+ ram\.percent \s+ cpu \s+ load_1m \s+ load_5m \s+ load_15m \s+ node\.role \s+ master \s+ name \n
((\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d* \s+ (-)?\d* \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ (-|[cdhilmrstvw]{1,11}) \s+ [-*x] \s+ (\S+\s?)+ \n)+ $/
/^ ip \s+ heap\.percent \s+ ram\.percent \s+ cpu \s+ load_1m \s+ load_5m \s+ load_15m \s+ node\.role \s+ cluster_manager \s+ name \n
((\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d* \s+ (-)?\d* \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ (-|[cdhilmrstvw]{1,11}) \s+ [-*x] \s+ (\S+\s?)+ \n)+ $/
- do:
cat.nodes:
Expand Down
4 changes: 2 additions & 2 deletions distribution/src/config/opensearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ ${path.logs}
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
# Bootstrap the cluster using an initial set of cluster-manager-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#cluster.initial_cluster_manager_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import com.google.common.jimfs.Configuration;
import com.google.common.jimfs.Jimfs;
import org.opensearch.core.internal.io.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.tests.util.LuceneTestCase;
import org.opensearch.cli.CommandTestCase;
import org.opensearch.common.io.PathUtilsForTesting;
import org.opensearch.env.Environment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
import com.google.common.jimfs.Configuration;
import com.google.common.jimfs.Jimfs;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.tests.util.LuceneTestCase;
import org.bouncycastle.bcpg.ArmoredOutputStream;
import org.bouncycastle.bcpg.BCPGOutputStream;
import org.bouncycastle.bcpg.HashAlgorithmTags;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import java.util.Map;
import java.util.stream.Collectors;

import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.tests.util.LuceneTestCase;
import org.opensearch.LegacyESVersion;
import org.opensearch.Version;
import org.opensearch.cli.ExitCodes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

package org.opensearch.plugins;

import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.tests.util.LuceneTestCase;
import org.opensearch.Version;
import org.opensearch.cli.ExitCodes;
import org.opensearch.cli.MockTerminal;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ec18851f1976d5b810ae1a5fcc32520d2d38f77a

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
926e48c451166a291f1ce6c6276d9abbefa7c00f
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

package org.opensearch.core.internal.io;

import org.apache.lucene.mockfile.FilterFileSystemProvider;
import org.apache.lucene.mockfile.FilterPath;
import org.apache.lucene.tests.mockfile.FilterFileSystemProvider;
import org.apache.lucene.tests.mockfile.FilterPath;
import org.apache.lucene.util.Constants;
import org.opensearch.common.CheckedConsumer;
import org.opensearch.common.io.PathUtils;
Expand Down
1 change: 0 additions & 1 deletion libs/x-content/licenses/jackson-core-2.12.6.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions libs/x-content/licenses/jackson-core-2.13.2.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0a6a0e0620d51833feffc67bccb51937b2345763

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4fc77e1ec6922fc48bf1181e4b38f600dac222ff

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
984bb22f310ebbedc967d206e672f8acf766a98e

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5601496b5b6e43d947aeeffbffadb2b18961c731
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.apache.lucene.document.SortedNumericDocValuesField;
import org.apache.lucene.document.StringField;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.tests.index.RandomIndexWriter;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.store.Directory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void testCustomWordDelimiterQueryString() {
.put("analysis.filter.custom_word_delimiter.split_on_numerics", "false")
.put("analysis.filter.custom_word_delimiter.stem_english_possessive", "false")
)
.addMapping("type1", "field1", "type=text,analyzer=my_analyzer", "field2", "type=text,analyzer=my_analyzer")
.setMapping("field1", "type=text,analyzer=my_analyzer", "field2", "type=text,analyzer=my_analyzer")
);

client().prepareIndex("test").setId("1").setSource("field1", "foo bar baz", "field2", "not needed").get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

package org.opensearch.analysis.common;

import org.apache.lucene.analysis.CannedTokenStream;
import org.apache.lucene.analysis.Token;
import org.apache.lucene.tests.analysis.CannedTokenStream;
import org.apache.lucene.tests.analysis.Token;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.core.WhitespaceTokenizer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

package org.opensearch.analysis.common;

import org.apache.lucene.analysis.CannedTokenStream;
import org.apache.lucene.analysis.Token;
import org.apache.lucene.tests.analysis.CannedTokenStream;
import org.apache.lucene.tests.analysis.Token;
import org.apache.lucene.analysis.TokenStream;
import org.opensearch.common.settings.Settings;
import org.opensearch.index.Index;
Expand Down
Loading

0 comments on commit 3b57a13

Please sign in to comment.