Skip to content

Commit 4e3d55f

Browse files
authored
Merge branch 'main' into source-mem-accounting
2 parents edaeebe + fcf7130 commit 4e3d55f

File tree

120 files changed

+1695
-717
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+1695
-717
lines changed

client/test/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ dependencies {
2828
api "org.hamcrest:hamcrest:${versions.hamcrest}"
2929

3030
// mockito
31-
api 'org.mockito:mockito-core:5.11.0'
32-
api 'org.mockito:mockito-subclass:5.11.0'
33-
api 'net.bytebuddy:byte-buddy:1.14.12'
31+
api 'org.mockito:mockito-core:5.15.2'
32+
api 'org.mockito:mockito-subclass:5.15.2'
33+
api 'net.bytebuddy:byte-buddy:1.15.11'
3434
api 'org.objenesis:objenesis:3.3'
3535
}
3636

docs/changelog/120944.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 120944
2+
summary: Aggregations cancellation after collection
3+
area: Aggregations
4+
type: bug
5+
issues:
6+
- 108701

docs/changelog/121196.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 121196
2+
summary: Fix geoip databases index access after system feature migration
3+
area: Ingest Node
4+
type: bug
5+
issues: []

docs/changelog/121667.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
pr: 121667
2+
summary: Add deprecation warning for flush API
3+
area: Machine Learning
4+
type: deprecation
5+
issues:
6+
- 121506
7+
deprecation:
8+
title: Add deprecation warning for flush API
9+
area: REST API
10+
details: The anomaly detection job flush API is deprecated since it is only required for the post data API, which was deprecated since 7.11.0.
11+
impact: This should have a minimal impact on users as the flush API is only required for the post data API, which was deprecated since 7.11.0.

docs/changelog/121911.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 121911
2+
summary: Fix ENRICH validation for use of wildcards
3+
area: ES|QL
4+
type: bug
5+
issues: []

gradle/build.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ apache-compress = "org.apache.commons:commons-compress:1.26.1"
1111
apache-rat = "org.apache.rat:apache-rat:0.11"
1212
asm = { group = "org.ow2.asm", name="asm", version.ref="asm" }
1313
asm-tree = { group = "org.ow2.asm", name="asm-tree", version.ref="asm" }
14-
bytebuddy = "net.bytebuddy:byte-buddy:1.14.12"
14+
bytebuddy = "net.bytebuddy:byte-buddy:1.15.11"
1515
checkstyle = "com.puppycrawl.tools:checkstyle:10.3"
1616
commons-codec = "commons-codec:commons-codec:1.11"
1717
commmons-io = "commons-io:commons-io:2.2"

gradle/verification-metadata.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,9 +1724,9 @@
17241724
<sha256 value="1d31696445697720527091754369082a6651bd49781b6005deb94e56753406f9" origin="Generated by Gradle"/>
17251725
</artifact>
17261726
</component>
1727-
<component group="net.bytebuddy" name="byte-buddy" version="1.14.12">
1728-
<artifact name="byte-buddy-1.14.12.jar">
1729-
<sha256 value="970636134d61c183b19f8f58fa631e30d2f2abca344b37848a393cac7863dd70" origin="Generated by Gradle"/>
1727+
<component group="net.bytebuddy" name="byte-buddy" version="1.15.11">
1728+
<artifact name="byte-buddy-1.15.11.jar">
1729+
<sha256 value="fa08998aae1e7bdae83bde0712c50e8444d71c0e0c196bb2247ade8d4ad0eb90" origin="Generated by Gradle"/>
17301730
</artifact>
17311731
</component>
17321732
<component group="net.java.dev.jets3t" name="jets3t" version="0.9.0">
@@ -4118,14 +4118,14 @@
41184118
<sha256 value="f97483ba0944b9fa133aa29638764ddbeadb51ec3dbc02074c58fa2caecd07fa" origin="Generated by Gradle"/>
41194119
</artifact>
41204120
</component>
4121-
<component group="org.mockito" name="mockito-core" version="5.11.0">
4122-
<artifact name="mockito-core-5.11.0.jar">
4123-
<sha256 value="f076c96b1f49b8d9bc42e46b0969aaf5684c40c8b5b679d400e5d880073a0e00" origin="Generated by Gradle"/>
4121+
<component group="org.mockito" name="mockito-core" version="5.15.2">
4122+
<artifact name="mockito-core-5.15.2.jar">
4123+
<sha256 value="bf48b7372d9491d5ec8aebb4cdd187d15663931599c0fbe7410166ce0e1e58ff" origin="Generated by Gradle"/>
41244124
</artifact>
41254125
</component>
4126-
<component group="org.mockito" name="mockito-subclass" version="5.11.0">
4127-
<artifact name="mockito-subclass-5.11.0.jar">
4128-
<sha256 value="61e65116bf6178cd3a5f1cecc0d73d68395e7c175d07a7f9478650f55b36fb1d" origin="Generated by Gradle"/>
4126+
<component group="org.mockito" name="mockito-subclass" version="5.15.2">
4127+
<artifact name="mockito-subclass-5.15.2.jar">
4128+
<sha256 value="bf332f658d5437446525911449da3474be170053735bf870ac2caaeaffc2fd34" origin="Generated by Gradle"/>
41294129
</artifact>
41304130
</component>
41314131
<component group="org.mortbay.jetty" name="jetty" version="6.1.26">

libs/entitlement/qa/src/javaRestTest/java/org/elasticsearch/entitlement/qa/AbstractEntitlementsIT.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,17 @@ public abstract class AbstractEntitlementsIT extends ESRestTestCase {
3434
Map.of("properties", List.of("es.entitlements.checkSetSystemProperty", "es.entitlements.checkClearSystemProperty"))
3535
)
3636
);
37-
38-
builder.value(Map.of("file", Map.of("path", tempDir.resolve("read_dir"), "mode", "read")));
39-
builder.value(Map.of("file", Map.of("path", tempDir.resolve("read_write_dir"), "mode", "read_write")));
40-
builder.value(Map.of("file", Map.of("path", tempDir.resolve("read_file"), "mode", "read")));
41-
builder.value(Map.of("file", Map.of("path", tempDir.resolve("read_write_file"), "mode", "read_write")));
37+
builder.value(
38+
Map.of(
39+
"files",
40+
List.of(
41+
Map.of("path", tempDir.resolve("read_dir"), "mode", "read"),
42+
Map.of("path", tempDir.resolve("read_write_dir"), "mode", "read_write"),
43+
Map.of("path", tempDir.resolve("read_file"), "mode", "read"),
44+
Map.of("path", tempDir.resolve("read_write_file"), "mode", "read_write")
45+
)
46+
)
47+
);
4248
};
4349

4450
private final String actionName;

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/FileAccessTree.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
package org.elasticsearch.entitlement.runtime.policy;
1111

12-
import org.elasticsearch.entitlement.runtime.policy.entitlements.FileEntitlement;
12+
import org.elasticsearch.entitlement.runtime.policy.entitlements.FilesEntitlement;
1313

1414
import java.nio.file.Path;
1515
import java.util.ArrayList;
@@ -20,18 +20,19 @@
2020
import static org.elasticsearch.core.PathUtils.getDefaultFileSystem;
2121

2222
public final class FileAccessTree {
23-
public static final FileAccessTree EMPTY = new FileAccessTree(List.of());
23+
public static final FileAccessTree EMPTY = new FileAccessTree(FilesEntitlement.EMPTY);
2424
private static final String FILE_SEPARATOR = getDefaultFileSystem().getSeparator();
2525

2626
private final String[] readPaths;
2727
private final String[] writePaths;
2828

29-
private FileAccessTree(List<FileEntitlement> fileEntitlements) {
29+
private FileAccessTree(FilesEntitlement filesEntitlement) {
3030
List<String> readPaths = new ArrayList<>();
3131
List<String> writePaths = new ArrayList<>();
32-
for (FileEntitlement fileEntitlement : fileEntitlements) {
33-
String path = normalizePath(Path.of(fileEntitlement.path()));
34-
if (fileEntitlement.mode() == FileEntitlement.Mode.READ_WRITE) {
32+
for (FilesEntitlement.FileData fileData : filesEntitlement.filesData()) {
33+
var path = normalizePath(Path.of(fileData.path()));
34+
var mode = fileData.mode();
35+
if (mode == FilesEntitlement.Mode.READ_WRITE) {
3536
writePaths.add(path);
3637
}
3738
readPaths.add(path);
@@ -44,8 +45,8 @@ private FileAccessTree(List<FileEntitlement> fileEntitlements) {
4445
this.writePaths = writePaths.toArray(new String[0]);
4546
}
4647

47-
public static FileAccessTree of(List<FileEntitlement> fileEntitlements) {
48-
return new FileAccessTree(fileEntitlements);
48+
public static FileAccessTree of(FilesEntitlement filesEntitlement) {
49+
return new FileAccessTree(filesEntitlement);
4950
}
5051

5152
boolean canRead(Path path) {

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/PolicyManager.java

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import org.elasticsearch.entitlement.runtime.policy.entitlements.CreateClassLoaderEntitlement;
1717
import org.elasticsearch.entitlement.runtime.policy.entitlements.Entitlement;
1818
import org.elasticsearch.entitlement.runtime.policy.entitlements.ExitVMEntitlement;
19-
import org.elasticsearch.entitlement.runtime.policy.entitlements.FileEntitlement;
19+
import org.elasticsearch.entitlement.runtime.policy.entitlements.FilesEntitlement;
2020
import org.elasticsearch.entitlement.runtime.policy.entitlements.InboundNetworkEntitlement;
2121
import org.elasticsearch.entitlement.runtime.policy.entitlements.LoadNativeLibrariesEntitlement;
2222
import org.elasticsearch.entitlement.runtime.policy.entitlements.OutboundNetworkEntitlement;
@@ -73,14 +73,16 @@ public static ModuleEntitlements none(String componentName) {
7373
}
7474

7575
public static ModuleEntitlements from(String componentName, List<Entitlement> entitlements) {
76-
var fileEntitlements = entitlements.stream()
77-
.filter(e -> e.getClass().equals(FileEntitlement.class))
78-
.map(e -> (FileEntitlement) e)
79-
.toList();
76+
FilesEntitlement filesEntitlement = FilesEntitlement.EMPTY;
77+
for (Entitlement entitlement : entitlements) {
78+
if (entitlement instanceof FilesEntitlement) {
79+
filesEntitlement = (FilesEntitlement) entitlement;
80+
}
81+
}
8082
return new ModuleEntitlements(
8183
componentName,
8284
entitlements.stream().collect(groupingBy(Entitlement::getClass)),
83-
FileAccessTree.of(fileEntitlements)
85+
FileAccessTree.of(filesEntitlement)
8486
);
8587
}
8688

@@ -164,23 +166,14 @@ private static Map<String, List<Entitlement>> buildScopeEntitlementsMap(Policy p
164166
}
165167

166168
private static void validateEntitlementsPerModule(String componentName, String moduleName, List<Entitlement> entitlements) {
167-
Set<Class<? extends Entitlement>> flagEntitlements = new HashSet<>();
169+
Set<Class<? extends Entitlement>> found = new HashSet<>();
168170
for (var e : entitlements) {
169-
if (e instanceof FileEntitlement) {
170-
continue;
171-
}
172-
if (flagEntitlements.contains(e.getClass())) {
171+
if (found.contains(e.getClass())) {
173172
throw new IllegalArgumentException(
174-
"["
175-
+ componentName
176-
+ "] using module ["
177-
+ moduleName
178-
+ "] found duplicate flag entitlements ["
179-
+ e.getClass().getName()
180-
+ "]"
173+
"[" + componentName + "] using module [" + moduleName + "] found duplicate entitlement [" + e.getClass().getName() + "]"
181174
);
182175
}
183-
flagEntitlements.add(e.getClass());
176+
found.add(e.getClass());
184177
}
185178
}
186179

0 commit comments

Comments
 (0)