Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into patch_source_mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
jimczi committed Sep 18, 2024
2 parents caea069 + 1c0bab1 commit d96cb8d
Show file tree
Hide file tree
Showing 294 changed files with 7,446 additions and 4,381 deletions.
15 changes: 12 additions & 3 deletions .buildkite/scripts/lucene-snapshot/update-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,21 @@ if [[ "$BUILDKITE_BRANCH" != "lucene_snapshot"* ]]; then
exit 1
fi

echo --- Updating "$BUILDKITE_BRANCH" branch with main
if [[ "$BUILDKITE_BRANCH" == "lucene_snapshot_10" ]]; then
UPSTREAM="main"
elif [[ "$BUILDKITE_BRANCH" == "lucene_snapshot" ]]; then
UPSTREAM="8.x"
else
echo "Error: unknown branch: $BUILDKITE_BRANCH"
exit 1
fi

echo --- Updating "$BUILDKITE_BRANCH" branch with "$UPSTREAM"

git config --global user.name elasticsearchmachine
git config --global user.email '[email protected]'

git checkout "$BUILDKITE_BRANCH"
git fetch origin main
git merge --no-edit origin/main
git fetch origin "$UPSTREAM"
git merge --no-edit "origin/$UPSTREAM"
git push origin "$BUILDKITE_BRANCH"
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
package org.elasticsearch.benchmark.tdigest;

import org.elasticsearch.tdigest.Sort;
import org.elasticsearch.tdigest.arrays.TDigestDoubleArray;
import org.elasticsearch.tdigest.arrays.TDigestIntArray;
import org.elasticsearch.tdigest.arrays.WrapperTDigestArrays;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
Expand All @@ -35,7 +38,6 @@
import org.openjdk.jmh.annotations.Threads;
import org.openjdk.jmh.annotations.Warmup;

import java.util.Arrays;
import java.util.Random;
import java.util.concurrent.TimeUnit;

Expand All @@ -49,7 +51,7 @@
@State(Scope.Thread)
public class SortBench {
private final int size = 100000;
private final double[] values = new double[size];
private final TDigestDoubleArray values = WrapperTDigestArrays.INSTANCE.newDoubleArray(size);

@Param({ "0", "1", "-1" })
public int sortDirection;
Expand All @@ -58,22 +60,22 @@ public class SortBench {
public void setup() {
Random prng = new Random(999983);
for (int i = 0; i < size; i++) {
values[i] = prng.nextDouble();
values.set(i, prng.nextDouble());
}
if (sortDirection > 0) {
Arrays.sort(values);
values.sort();
} else if (sortDirection < 0) {
Arrays.sort(values);
Sort.reverse(values, 0, values.length);
values.sort();
Sort.reverse(values, 0, values.size());
}
}

@Benchmark
public void quicksort() {
int[] order = new int[size];
public void stableSort() {
TDigestIntArray order = WrapperTDigestArrays.INSTANCE.newIntArray(size);
for (int i = 0; i < size; i++) {
order[i] = i;
order.set(i, i);
}
Sort.sort(order, values, null, values.length);
Sort.stableSort(order, values, values.size());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

package org.elasticsearch.benchmark.tdigest;

import org.elasticsearch.tdigest.AVLTreeDigest;
import org.elasticsearch.tdigest.MergingDigest;
import org.elasticsearch.tdigest.TDigest;
import org.elasticsearch.tdigest.arrays.WrapperTDigestArrays;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
Expand Down Expand Up @@ -61,13 +61,19 @@ public enum TDigestFactory {
MERGE {
@Override
TDigest create(double compression) {
return new MergingDigest(compression, (int) (10 * compression));
return new MergingDigest(WrapperTDigestArrays.INSTANCE, compression, (int) (10 * compression));
}
},
AVL_TREE {
@Override
TDigest create(double compression) {
return new AVLTreeDigest(compression);
return TDigest.createAvlTreeDigest(WrapperTDigestArrays.INSTANCE, compression);
}
},
HYBRID {
@Override
TDigest create(double compression) {
return TDigest.createHybridDigest(WrapperTDigestArrays.INSTANCE, compression);
}
};

Expand All @@ -77,7 +83,7 @@ TDigest create(double compression) {
@Param({ "100", "300" })
double compression;

@Param({ "MERGE", "AVL_TREE" })
@Param({ "MERGE", "AVL_TREE", "HYBRID" })
TDigestFactory tdigestFactory;

@Param({ "NORMAL", "GAUSSIAN" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.elasticsearch.xcontent.XContentParserConfiguration;
import org.elasticsearch.xcontent.XContentType;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand Down Expand Up @@ -106,9 +105,7 @@ private void verifyOverview() throws Exception {
private void verifyTarball(Map<String, byte[]> data) throws Exception {
for (String tgz : List.of("a.tgz", "b.tgz")) {
try (
TarArchiveInputStream tis = new TarArchiveInputStream(
new GZIPInputStream(new BufferedInputStream(Files.newInputStream(target.resolve(tgz))))
)
TarArchiveInputStream tis = new TarArchiveInputStream(new GZIPInputStream(Files.newInputStream(target.resolve(tgz)), 8192))
) {
TarArchiveEntry entry = tis.getNextTarEntry();
assertNotNull(entry);
Expand Down
26 changes: 3 additions & 23 deletions distribution/tools/java-version-checker/build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,10 @@
apply plugin: 'elasticsearch.build'

sourceSets {
unsupportedJdkVersionEntrypoint
}

tasks.named(sourceSets.unsupportedJdkVersionEntrypoint.compileJavaTaskName).configure {
targetCompatibility = JavaVersion.VERSION_1_8
}


tasks.named("jar") {
manifest {
attributes("Multi-Release": "true")
}

FileCollection mainOutput = sourceSets.main.output;
from(sourceSets.unsupportedJdkVersionEntrypoint.output)
eachFile { details ->
if (details.path.equals("org/elasticsearch/tools/java_version_checker/JavaVersionChecker.class") &&
mainOutput.asFileTree.contains(details.file)) {
details.relativePath = details.relativePath.prepend("META-INF/versions/17")
}
}
compileJava {
options.release = 8
}

// TODO revisit forbiddenApis issues
["javadoc", "forbiddenApisMain", "forbiddenApisUnsupportedJdkVersionEntrypoint"].each {
["javadoc", "forbiddenApisMain"].each {
tasks.named(it).configure { enabled = false }
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
package org.elasticsearch.tools.java_version_checker;

import java.util.Arrays;
import java.util.Locale;

/**
* Java 17 compatible main which just exits without error.
* Java 8 compatible main to check the runtime version
*/
final class JavaVersionChecker {

Expand All @@ -23,5 +24,27 @@ public static void main(final String[] args) {
if (args.length != 0) {
throw new IllegalArgumentException("expected zero arguments but was " + Arrays.toString(args));
}

final int MIN_VERSION = 21;
final int version;
String versionString = System.getProperty("java.specification.version");
if (versionString.equals("1.8")) {
version = 8;
} else {
version = Integer.parseInt(versionString);
}
if (version >= MIN_VERSION) {
return;
}

final String message = String.format(
Locale.ROOT,
"The minimum required Java version is %d; your Java version %d from [%s] does not meet that requirement.",
MIN_VERSION,
version,
System.getProperty("java.home")
);
System.err.println(message);
System.exit(1);
}
}

This file was deleted.

5 changes: 0 additions & 5 deletions docs/changelog/111684.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions docs/changelog/112677.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 112677
summary: Stream OpenAI Completion
area: Machine Learning
type: enhancement
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/112678.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 112678
summary: Make "too many clauses" throw IllegalArgumentException to avoid 500s
area: Search
type: bug
issues:
- 112177
5 changes: 5 additions & 0 deletions docs/changelog/112888.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 112888
summary: Fix `getDatabaseType` for unusual MMDBs
area: Ingest Node
type: bug
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/112916.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 112916
summary: Allow out of range term queries for numeric types
area: Search
type: bug
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/112973.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 112973
summary: Fix verbose get data stream API not requiring extra privileges
area: Data streams
type: bug
issues: []
13 changes: 13 additions & 0 deletions docs/reference/release-notes/8.15.0.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ signed integer) may encounter errors (issue: {es-issue}111854[#111854])
`xpack.security.authc.realms.*.files.role_mapping` configuration option. As a workaround, custom role mappings
can be configured using the https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html[REST API] (issue: {es-issue}112503[#112503])

* ES|QL queries can lead to node crashes due to Out Of Memory errors when:
** Multiple indices match the query pattern
** These indices have many conflicting field mappings
** Many of those fields are included in the request
These issues deplete heap memory, increasing the likelihood of OOM errors. (issue: {es-issue}111964[#111964], {es-issue}111358[#111358]).
+
To work around this issue, you have a number of options:
** Downgrade to an earlier version
** Upgrade to 8.15.2 upon release
** Follow the instructions to
<<esql-kibana-enable,disable ES|QL queries in {kib}>>
** Change the default data view in Discover to a smaller set of indices and/or one with fewer mapping conflicts.

[[breaking-8.15.0]]
[float]
=== Breaking changes
Expand Down
13 changes: 13 additions & 0 deletions docs/reference/release-notes/8.15.1.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ Also see <<breaking-changes-8.15,Breaking changes in 8.15>>.
`xpack.security.authc.realms.*.files.role_mapping` configuration option. As a workaround, custom role mappings
can be configured using the https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html[REST API] (issue: {es-issue}112503[#112503])

* ES|QL queries can lead to node crashes due to Out Of Memory errors when:
** Multiple indices match the query pattern
** These indices have many conflicting field mappings
** Many of those fields are included in the request
These issues deplete heap memory, increasing the likelihood of OOM errors. (issue: {es-issue}111964[#111964], {es-issue}111358[#111358]).
+
To work around this issue, you have a number of options:
** Downgrade to an earlier version
** Upgrade to 8.15.2 upon release
** Follow the instructions to
<<esql-kibana-enable,disable ES|QL queries in {kib}>>
** Change the default data view in Discover to a smaller set of indices and/or one with fewer mapping conflicts.

[[bug-8.15.1]]
[float]
=== Bug fixes
Expand Down
32 changes: 31 additions & 1 deletion docs/reference/rest-api/security/get-service-accounts.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ GET /_security/service/elastic/fleet-server
"cluster": [
"monitor",
"manage_own_api_key",
"read_fleet_secrets"
"read_fleet_secrets",
"cluster:admin/xpack/connector/*"
],
"indices": [
{
Expand Down Expand Up @@ -238,6 +239,35 @@ GET /_security/service/elastic/fleet-server
"auto_configure"
],
"allow_restricted_indices": false
},
{
"names": [
".elastic-connectors*"
],
"privileges": [
"read",
"write",
"monitor",
"create_index",
"auto_configure",
"maintenance"
],
"allow_restricted_indices": false
},
{
"names": [
"content-*",
".search-acl-filter-*"
],
"privileges": [
"read",
"write",
"monitor",
"create_index",
"auto_configure",
"maintenance"
],
"allow_restricted_indices": false
}
],
"applications": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ stream or index.
==================================================
Source-only snapshots are only supported if the `_source` field is enabled and no source-filtering is applied.
When you restore a source-only snapshot:
As a result, indices adopting synthetic source cannot be restored. When you restore a source-only snapshot:
* The restored index is read-only and can only serve `match_all` search or scroll requests to enable reindexing.
Expand Down
1 change: 1 addition & 0 deletions libs/tdigest/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@

module org.elasticsearch.tdigest {
exports org.elasticsearch.tdigest;
exports org.elasticsearch.tdigest.arrays;
}
Loading

0 comments on commit d96cb8d

Please sign in to comment.