Skip to content

Commit

Permalink
Merge branch 'opensearch-project:main' into segment-download-stats
Browse files Browse the repository at this point in the history
  • Loading branch information
shourya035 authored Jul 11, 2023
2 parents d826579 + 7208edc commit 2213186
Show file tree
Hide file tree
Showing 144 changed files with 3,156 additions and 818 deletions.
28 changes: 20 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Allow mmap to use new JDK-19 preview APIs in Apache Lucene 9.4+ ([#5151](https://github.com/opensearch-project/OpenSearch/pull/5151))
- Add events correlation engine plugin ([#6854](https://github.com/opensearch-project/OpenSearch/issues/6854))
- Add support for ignoring missing Javadoc on generated code using annotation ([#7604](https://github.com/opensearch-project/OpenSearch/pull/7604))
- Add partial results support for concurrent segment search ([#8306](https://github.com/opensearch-project/OpenSearch/pull/8306))

### Dependencies
- Bump `log4j-core` from 2.18.0 to 2.19.0
Expand All @@ -36,11 +37,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- OpenJDK Update (April 2023 Patch releases) ([#7344](https://github.com/opensearch-project/OpenSearch/pull/7344)
- Bump `com.google.http-client:google-http-client:1.43.2` from 1.42.0 to 1.43.2 ([7928](https://github.com/opensearch-project/OpenSearch/pull/7928)))
- Add Opentelemetry dependencies ([#7543](https://github.com/opensearch-project/OpenSearch/issues/7543))
- Bump `org.bouncycastle:bcprov-jdk15on` to `org.bouncycastle:bcprov-jdk15to18` version 1.75 ([8247](https://github.com/opensearch-project/OpenSearch/pull/8247))
- Bump `org.bouncycastle:bcmail-jdk15on` to `org.bouncycastle:bcmail-jdk15to18` version 1.75 ([8247](https://github.com/opensearch-project/OpenSearch/pull/8247))
- Bump `org.bouncycastle:bcpkix-jdk15on` to `org.bouncycastle:bcpkix-jdk15to18` version 1.75 ([8247](https://github.com/opensearch-project/OpenSearch/pull/8247))


- Bump `org.bouncycastle:bcprov-jdk15on` to `org.bouncycastle:bcprov-jdk15to18` version 1.75 ([#8247](https://github.com/opensearch-project/OpenSearch/pull/8247))
- Bump `org.bouncycastle:bcmail-jdk15on` to `org.bouncycastle:bcmail-jdk15to18` version 1.75 ([#8247](https://github.com/opensearch-project/OpenSearch/pull/8247))
- Bump `org.bouncycastle:bcpkix-jdk15on` to `org.bouncycastle:bcpkix-jdk15to18` version 1.75 ([#8247](https://github.com/opensearch-project/OpenSearch/pull/8247))

### Changed
- [CCR] Add getHistoryOperationsFromTranslog method to fetch the history snapshot from translogs ([#3948](https://github.com/opensearch-project/OpenSearch/pull/3948))
Expand All @@ -52,6 +51,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Pass localNode info to all plugins on node start ([#7919](https://github.com/opensearch-project/OpenSearch/pull/7919))
- Improved performance of parsing floating point numbers ([#7909](https://github.com/opensearch-project/OpenSearch/pull/7909))
- Move span actions to Scope ([#8411](https://github.com/opensearch-project/OpenSearch/pull/8411))
- Add wrapper tracer implementation

### Deprecated

Expand All @@ -78,6 +78,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Replaces ZipInputStream with ZipFile to fix Zip Slip vulnerability ([#7230](https://github.com/opensearch-project/OpenSearch/pull/7230))
- Add missing validation/parsing of SearchBackpressureMode of SearchBackpressureSettings ([#7541](https://github.com/opensearch-project/OpenSearch/pull/7541))
- Adds log4j configuration for telemetry LogSpanExporter ([#8393](https://github.com/opensearch-project/OpenSearch/pull/8393))
- Fix painless casting bug, which crashes the OpenSearch process ([#8315](https://github.com/opensearch-project/OpenSearch/pull/8315))

### Security

Expand All @@ -101,10 +102,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Support transport action names when registering NamedRoutes ([#7957](https://github.com/opensearch-project/OpenSearch/pull/7957))
- Create concept of persistent ThreadContext headers that are unstashable ([#8291]()https://github.com/opensearch-project/OpenSearch/pull/8291)
- Enable Partial Flat Object ([#7997](https://github.com/opensearch-project/OpenSearch/pull/7997))
- Add jdk.incubator.vector module support for JDK 20+ ([#8601](https://github.com/opensearch-project/OpenSearch/pull/8601))

### Dependencies
- Bump `com.azure:azure-storage-common` from 12.21.0 to 12.21.1 (#7566, #7814)
- Bump `com.google.guava:guava` from 30.1.1-jre to 32.0.0-jre (#7565, #7811, #7807, #7808)
- Bump `com.google.guava:guava` from 30.1.1-jre to 32.1.1-jre (#7565, #7811, #7807, #7808, #8402, #8400, #8401, #8581)
- Bump `net.minidev:json-smart` from 2.4.10 to 2.4.11 (#7660, #7812)
- Bump `org.gradle.test-retry` from 1.5.2 to 1.5.3 (#7810)
- Bump `com.diffplug.spotless` from 6.17.0 to 6.18.0 (#7896)
Expand All @@ -124,7 +126,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Bump `io.projectreactor:reactor-core` from 3.4.18 to 3.5.6 in /plugins/repository-azure ([#8016](https://github.com/opensearch-project/OpenSearch/pull/8016))
- Bump `spock-core` from 2.1-groovy-3.0 to 2.3-groovy-3.0 ([#8122](https://github.com/opensearch-project/OpenSearch/pull/8122))
- Bump `com.networknt:json-schema-validator` from 1.0.83 to 1.0.84 (#8141)
- Bump `com.netflix.nebula:gradle-info-plugin` from 12.1.3 to 12.1.4 (#8139)
- Bump `com.netflix.nebula:gradle-info-plugin` from 12.1.3 to 12.1.5 (#8139, #8568)
- Bump `commons-io:commons-io` from 2.12.0 to 2.13.0 in /plugins/discovery-azure-classic ([#8140](https://github.com/opensearch-project/OpenSearch/pull/8140))
- Bump `mockito` from 5.2.0 to 5.4.0 ([#8181](https://github.com/opensearch-project/OpenSearch/pull/8181))
- Bump `netty` from 4.1.93.Final to 4.1.94.Final ([#8191](https://github.com/opensearch-project/OpenSearch/pull/8191))
Expand All @@ -136,6 +138,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Update Apache HttpCore/ HttpClient and Apache HttpCore5 / HttpClient5 dependencies ([#8434](https://github.com/opensearch-project/OpenSearch/pull/8434))
- Bump `org.apache.maven:maven-model` from 3.9.2 to 3.9.3 (#8403)
- Bump `io.projectreactor.netty:reactor-netty` and `io.projectreactor.netty:reactor-netty-core` from 1.1.7 to 1.1.8 (#8405)
- Bump `com.azure:azure-storage-blob` from 12.22.2 to 12.22.3 (#8572)
- Bump `net.minidev:json-smart` from 2.4.11 to 2.5.0 ([#8576](https://github.com/opensearch-project/OpenSearch/pull/8576))
- Bump `com.google.jimfs:jimfs` from 1.2 to 1.3.0 (#8577, #8571)
- Bump `com.networknt:json-schema-validator` from 1.0.85 to 1.0.86 ([#8573](https://github.com/opensearch-project/OpenSearch/pull/8573))
- Bump `com.google.cloud:google-cloud-core-http` from 2.17.0 to 2.21.0 ([#8586](https://github.com/opensearch-project/OpenSearch/pull/8586))

### Changed
- Replace jboss-annotations-api_1.2_spec with jakarta.annotation-api ([#7836](https://github.com/opensearch-project/OpenSearch/pull/7836))
Expand All @@ -155,7 +162,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Move ZSTD compression codecs out of the sandbox ([#7908](https://github.com/opensearch-project/OpenSearch/pull/7908))
- Update ZSTD default compression level ([#8471](https://github.com/opensearch-project/OpenSearch/pull/8471))
- [Search Pipelines] Pass pipeline creation context to processor factories ([#8164](https://github.com/opensearch-project/OpenSearch/pull/8164))

- Enabling compression levels for zstd and zstd_no_dict ([#8312](https://github.com/opensearch-project/OpenSearch/pull/8312))
- Optimize Metadata build() to skip redundant computations as part of ClusterState build ([#7853](https://github.com/opensearch-project/OpenSearch/pull/7853))
- Add safeguard limits for file cache during node level allocation ([#8208](https://github.com/opensearch-project/OpenSearch/pull/8208))
- Move span actions to Scope ([#8411](https://github.com/opensearch-project/OpenSearch/pull/8411))
- Add wrapper tracer implementation ([#8565](https://github.com/opensearch-project/OpenSearch/pull/8565))

### Deprecated

Expand All @@ -170,6 +181,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fix mapping char_filter when mapping a hashtag ([#7591](https://github.com/opensearch-project/OpenSearch/pull/7591))
- Fix NPE in multiterms aggregations involving empty buckets ([#7318](https://github.com/opensearch-project/OpenSearch/pull/7318))
- Precise system clock time in MasterService debug logs ([#7902](https://github.com/opensearch-project/OpenSearch/pull/7902))
- Improve indexing performance for flat_object type ([#7855](https://github.com/opensearch-project/OpenSearch/pull/7855))

### Security

Expand Down
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@ gradle.projectsEvaluated {
if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_17) {
task.jvmArgs += ["-Djava.security.manager=allow"]
}
if (BuildParams.runtimeJavaVersion >= JavaVersion.VERSION_20) {
task.jvmArgs += ["--add-modules=jdk.incubator.vector"]
}
}
}

Expand Down
29 changes: 14 additions & 15 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import org.gradle.util.GradleVersion
plugins {
id 'java-gradle-plugin'
id 'groovy'
id 'java-test-fixtures'
}

group = 'org.opensearch.gradle'
Expand Down Expand Up @@ -78,17 +79,9 @@ if (JavaVersion.current() < JavaVersion.VERSION_11) {
}

sourceSets {
test {
java {
srcDirs += ['src/testFixtures/java']
}
}
integTest {
compileClasspath += sourceSets["main"].output + configurations["testRuntimeClasspath"]
runtimeClasspath += output + compileClasspath
java {
srcDirs += ['src/testFixtures/java']
}
}
}

Expand All @@ -114,7 +107,7 @@ dependencies {
api 'org.apache.ant:ant:1.10.13'
api 'com.netflix.nebula:gradle-extra-configurations-plugin:10.0.0'
api 'com.netflix.nebula:nebula-publishing-plugin:20.3.0'
api 'com.netflix.nebula:gradle-info-plugin:12.1.4'
api 'com.netflix.nebula:gradle-info-plugin:12.1.5'
api 'org.apache.rat:apache-rat:0.15'
api 'commons-io:commons-io:2.13.0'
api "net.java.dev.jna:jna:5.13.0"
Expand All @@ -125,16 +118,16 @@ dependencies {
api 'com.avast.gradle:gradle-docker-compose-plugin:0.16.12'
api "org.yaml:snakeyaml:${props.getProperty('snakeyaml')}"
api 'org.apache.maven:maven-model:3.9.3'
api 'com.networknt:json-schema-validator:1.0.85'
api 'com.networknt:json-schema-validator:1.0.86'
api 'org.jruby.jcodings:jcodings:1.0.58'
api 'org.jruby.joni:joni:2.2.1'
api "com.fasterxml.jackson.core:jackson-databind:${props.getProperty('jackson_databind')}"
api "org.ajoberstar.grgit:grgit-core:5.2.0"

testImplementation "junit:junit:${props.getProperty('junit')}"
testImplementation "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${props.getProperty('randomizedrunner')}"
testRuntimeOnly gradleApi()
testRuntimeOnly gradleTestKit()
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.35.0'
testImplementation "org.mockito:mockito-core:${props.getProperty('mockito')}"
integTestImplementation('org.spockframework:spock-core:2.3-groovy-3.0') {
Expand Down Expand Up @@ -183,7 +176,7 @@ if (project != rootProject) {
// build-tools is not ready for primetime with these...
tasks.named("dependencyLicenses").configure { it.enabled = false }
dependenciesInfo.enabled = false
disableTasks('forbiddenApisMain', 'forbiddenApisTest', 'forbiddenApisIntegTest')
disableTasks('forbiddenApisMain', 'forbiddenApisTest', 'forbiddenApisIntegTest', 'forbiddenApisTestFixtures')
jarHell.enabled = false
thirdPartyAudit.enabled = false
if (org.opensearch.gradle.info.BuildParams.inFipsJvm) {
Expand Down Expand Up @@ -250,6 +243,12 @@ if (project != rootProject) {
}
}

// disable fail-on-warnings for this specific task which trips Java 11 bug
// https://bugs.openjdk.java.net/browse/JDK-8209058
tasks.named("compileTestFixturesJava").configure {
options.compilerArgs -= '-Werror'
}

tasks.register("integTest", Test) {
inputs.dir(file("src/testKit")).withPropertyName("testkit dir").withPathSensitivity(PathSensitivity.RELATIVE)
systemProperty 'test.version_under_test', version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ public void setTestDistribution(TestDistribution distribution) {
}

@Override
public void extension(ExtensionsProperties extension) {
nodes.all(each -> each.extension(extension));
public void extension(boolean extensionsEnabled) {
nodes.all(each -> each.extension(extensionsEnabled));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
import org.opensearch.gradle.Version;
import org.opensearch.gradle.VersionProperties;
import org.opensearch.gradle.info.BuildParams;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;
import org.gradle.api.Action;
import org.gradle.api.Named;
import org.gradle.api.NamedDomainObjectContainer;
Expand Down Expand Up @@ -94,7 +92,6 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Scanner;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -144,7 +141,7 @@ public class OpenSearchNode implements TestClusterConfiguration {
private final Map<String, Configuration> pluginAndModuleConfigurations = new HashMap<>();
private final List<Provider<File>> plugins = new ArrayList<>();
private final List<Provider<File>> modules = new ArrayList<>();
private final List<ExtensionsProperties> extensions = new ArrayList<>();
private boolean extensionsEnabled = false;
final LazyPropertyMap<String, CharSequence> settings = new LazyPropertyMap<>("Settings", this);
private final LazyPropertyMap<String, CharSequence> keystoreSettings = new LazyPropertyMap<>("Keystore", this);
private final LazyPropertyMap<String, File> keystoreFiles = new LazyPropertyMap<>("Keystore files", this, FileEntry::new);
Expand Down Expand Up @@ -346,39 +343,8 @@ public void module(String moduleProjectPath) {
}

@Override
public void extension(ExtensionsProperties extensions) {
this.extensions.add(extensions);
}

public void writeExtensionFiles() {
try {
// Creates extensions.yml in the target directory
Path destination = getDistroDir().resolve("extensions").resolve("extensions.yml");
if (!Files.exists(getDistroDir().resolve("extensions"))) {
Files.createDirectory(getDistroDir().resolve("extensions"));
}
DumperOptions dumperOptions = new DumperOptions();
TestExtensionsList extensionsList = new TestExtensionsList(this.extensions);
dumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
Yaml yaml = new Yaml(dumperOptions);
Files.write(destination, yaml.dump(extensionsList).getBytes());

/*
* SnakeYaml creates a Yaml file with an unnecessary line at the top with the class name
* This section of code removes that line while keeping everything else the same.
*/

Scanner scanner = new Scanner(destination);
scanner.nextLine();
StringBuilder extensionsString = new StringBuilder();
while (scanner.hasNextLine()) {
extensionsString.append("\n" + scanner.nextLine());
}
Files.write(destination, extensionsString.toString().getBytes());

} catch (IOException e) {
throw new UncheckedIOException("Failed to write to extensions.yml", e);
}
public void extension(boolean extensionsEnabled) {
this.extensionsEnabled = extensionsEnabled;
}

@Override
Expand Down Expand Up @@ -551,10 +517,6 @@ public synchronized void start() {
logToProcessStdout("installed plugins");
}

if (!extensions.isEmpty()) {
writeExtensionFiles();
}

logToProcessStdout("Creating opensearch keystore with password set to [" + keystorePassword + "]");
if (keystorePassword.length() > 0) {
runOpenSearchBinScriptWithInput(keystorePassword + "\n" + keystorePassword, "opensearch-keystore", "create", "-p");
Expand Down Expand Up @@ -829,7 +791,7 @@ private void startOpenSearchProcess() {
environment.clear();
environment.putAll(getOpenSearchEnvironment());

if (!extensions.isEmpty()) {
if (extensionsEnabled) {
environment.put("OPENSEARCH_JAVA_OPTS", "-Dopensearch.experimental.feature.extensions.enabled=true");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public interface TestClusterConfiguration {

void setTestDistribution(TestDistribution distribution);

void extension(ExtensionsProperties extension);
void extension(boolean extensionsEnabled);

void plugin(Provider<RegularFile> plugin);

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/version.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jettison = 1.5.4
woodstox = 6.4.0
kotlin = 1.7.10
antlr4 = 4.11.1
guava = 32.0.1-jre
guava = 32.1.1-jre
protobuf = 3.22.3
jakarta_annotation = 1.3.5

Expand Down
4 changes: 4 additions & 0 deletions distribution/src/config/jvm.options
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,7 @@ ${error.file}

# Explicitly allow security manager (https://bugs.openjdk.java.net/browse/JDK-8270380)
18-:-Djava.security.manager=allow

# JDK 20+ Incubating Vector Module for SIMD optimizations;
# disabling may reduce performance on vector optimized lucene
20:--add-modules=jdk.incubator.vector
6 changes: 4 additions & 2 deletions distribution/tools/keystore-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ dependencies {
compileOnly project(":server")
compileOnly project(":libs:opensearch-cli")
testImplementation project(":test:framework")
testImplementation 'com.google.jimfs:jimfs:1.2'
testRuntimeOnly 'com.google.guava:guava:32.0.1-jre'
testImplementation 'com.google.jimfs:jimfs:1.3.0'
testRuntimeOnly("com.google.guava:guava:${versions.guava}") {
transitive = false
}
}
4 changes: 3 additions & 1 deletion distribution/tools/plugin-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ dependencies {
api "org.bouncycastle:bc-fips:1.0.2.3"
testImplementation project(":test:framework")
testImplementation 'com.google.jimfs:jimfs:1.2'
testRuntimeOnly 'com.google.guava:guava:32.0.1-jre'
testRuntimeOnly("com.google.guava:guava:${versions.guava}") {
transitive = false
}

implementation 'org.apache.commons:commons-compress:1.23.0'
}
Expand Down
6 changes: 4 additions & 2 deletions distribution/tools/upgrade-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ dependencies {
implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
implementation "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
testImplementation project(":test:framework")
testImplementation 'com.google.jimfs:jimfs:1.2'
testRuntimeOnly 'com.google.guava:guava:32.0.1-jre'
testImplementation 'com.google.jimfs:jimfs:1.3.0'
testRuntimeOnly("com.google.guava:guava:${versions.guava}") {
transitive = false
}
}

tasks.named("dependencyLicenses").configure {
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=5022b0b25fe182b0e50867e77f484501dba44feeea88f5c1f13b6b4660463640
distributionSha256Sum=7c3ad722e9b0ce8205b91560fd6ce8296ac3eadf065672242fd73c06b8eeb6ee
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

/**
* Interface defining telemetry
*
* @opensearch.internal
*/
public interface Telemetry {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

/**
* Base span
*
* @opensearch.internal
*/
public abstract class AbstractSpan implements Span {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@

/**
* Default implementation of Scope
*
* @opensearch.internal
*/
public class DefaultSpanScope implements SpanScope {
final class DefaultSpanScope implements SpanScope {

private final Span span;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
* The default tracer implementation. It handles tracing context propagation between spans by maintaining
* current active span in its storage
*
*
* @opensearch.internal
*/
public class DefaultTracer implements Tracer {
class DefaultTracer implements Tracer {
static final String THREAD_NAME = "th_name";

private final TracingTelemetry tracingTelemetry;
Expand Down
Loading

0 comments on commit 2213186

Please sign in to comment.