Skip to content

Commit e6de849

Browse files
committed
Merge branch 'failure-store-security-poc' of github.com:n1v0lg/elasticsearch into failure-store-security-poc
2 parents 91456e8 + 707a9a9 commit e6de849

File tree

53 files changed

+1425
-319
lines changed

Some content is hidden

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

53 files changed

+1425
-319
lines changed

.buildkite/pipelines/periodic.template.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ steps:
8686
ES_RUNTIME_JAVA:
8787
- openjdk21
8888
- openjdk23
89+
- openjdk24
8990
GRADLE_TASK:
9091
- checkPart1
9192
- checkPart2

.buildkite/pipelines/periodic.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ steps:
505505
ES_RUNTIME_JAVA:
506506
- openjdk21
507507
- openjdk23
508+
- openjdk24
508509
GRADLE_TASK:
509510
- checkPart1
510511
- checkPart2

docs/changelog/120751.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120751
2+
summary: Adding support for binary embedding type to Cohere service embedding type
3+
area: Machine Learning
4+
type: enhancement
5+
issues: []

docs/changelog/120957.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120957
2+
summary: Introduce `AllocationBalancingRoundSummaryService`
3+
area: Allocation
4+
type: enhancement
5+
issues: []

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,9 @@ private ModuleEntitlements computeEntitlements(Class<?> requestingClass) {
398398
var pluginName = pluginResolver.apply(requestingClass);
399399
if (pluginName != null) {
400400
var pluginEntitlements = pluginsEntitlements.get(pluginName);
401-
if (pluginEntitlements != null) {
401+
if (pluginEntitlements == null) {
402+
return ModuleEntitlements.NONE;
403+
} else {
402404
final String scopeName;
403405
if (requestingModule.isNamed() == false) {
404406
scopeName = ALL_UNNAMED;

libs/entitlement/src/test/java/org/elasticsearch/entitlement/runtime/policy/PolicyManagerTests.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public void testAgentsEntitlements() throws IOException, ClassNotFoundException
271271
createEmptyTestServerPolicy(),
272272
List.of(new CreateClassLoaderEntitlement()),
273273
Map.of(),
274-
c -> "test",
274+
c -> c.getPackageName().startsWith(TEST_AGENTS_PACKAGE_NAME) ? null : "test",
275275
TEST_AGENTS_PACKAGE_NAME,
276276
NO_ENTITLEMENTS_MODULE
277277
);
@@ -357,6 +357,22 @@ public void testDuplicateFlagEntitlements() {
357357
);
358358
}
359359

360+
/**
361+
* If the plugin resolver tells us a class is in a plugin, don't conclude that it's in an agent.
362+
*/
363+
public void testPluginResolverOverridesAgents() {
364+
var policyManager = new PolicyManager(
365+
createEmptyTestServerPolicy(),
366+
List.of(new CreateClassLoaderEntitlement()),
367+
Map.of(),
368+
c -> "test", // Insist that the class is in a plugin
369+
TEST_AGENTS_PACKAGE_NAME,
370+
NO_ENTITLEMENTS_MODULE
371+
);
372+
ModuleEntitlements notAgentsEntitlements = policyManager.getEntitlements(TestAgent.class);
373+
assertThat(notAgentsEntitlements.hasEntitlement(CreateClassLoaderEntitlement.class), is(false));
374+
}
375+
360376
private static Class<?> makeClassInItsOwnModule() throws IOException, ClassNotFoundException {
361377
final Path home = createTempDir();
362378
Path jar = createMockPluginJar(home);

muted-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ tests:
4646
- class: org.elasticsearch.packaging.test.WindowsServiceTests
4747
method: test81JavaOptsInJvmOptions
4848
issue: https://github.com/elastic/elasticsearch/issues/113313
49-
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
50-
method: test {p0=mtermvectors/10_basic/Tests catching other exceptions per item}
51-
issue: https://github.com/elastic/elasticsearch/issues/113325
5249
- class: org.elasticsearch.xpack.transform.integration.TransformIT
5350
method: testStopWaitForCheckpoint
5451
issue: https://github.com/elastic/elasticsearch/issues/106113
@@ -449,6 +446,9 @@ tests:
449446
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
450447
method: test {yaml=cat.aliases/10_basic/Complex alias}
451448
issue: https://github.com/elastic/elasticsearch/issues/121513
449+
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
450+
method: test {yaml=snapshot.create/10_basic/Create a snapshot for missing index}
451+
issue: https://github.com/elastic/elasticsearch/issues/121536
452452

453453
# Examples:
454454
#

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/mtermvectors/10_basic.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ setup:
33
- do:
44
indices.create:
55
index: testidx
6+
wait_for_active_shards: all
67
body:
78
mappings:
89
properties:
@@ -80,6 +81,7 @@ setup:
8081
- do:
8182
indices.create:
8283
index: testidx2
84+
wait_for_active_shards: all
8385

8486
- do:
8587
indices.put_alias:

server/src/main/java/org/elasticsearch/ReleaseVersions.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ public static IntFunction<String> generateVersionsLookup(Class<?> versionContain
7878
// replace all version lists with the smallest & greatest versions
7979
versions.replaceAll((k, v) -> {
8080
if (v.size() == 1) {
81-
return List.of(v.get(0));
81+
return List.of(v.getFirst());
8282
} else {
8383
v.sort(Comparator.naturalOrder());
84-
return List.of(v.get(0), v.get(v.size() - 1));
84+
return List.of(v.getFirst(), v.getLast());
8585
}
8686
});
8787

@@ -100,14 +100,14 @@ private static IntFunction<String> lookupFunction(NavigableMap<Integer, List<Ver
100100

101101
String lowerBound, upperBound;
102102
if (versionRange != null) {
103-
lowerBound = versionRange.get(0).toString();
104-
upperBound = lastItem(versionRange).toString();
103+
lowerBound = versionRange.getFirst().toString();
104+
upperBound = versionRange.getLast().toString();
105105
} else {
106106
// infer the bounds from the surrounding entries
107107
var lowerRange = versions.lowerEntry(id);
108108
if (lowerRange != null) {
109109
// the next version is just a guess - might be a newer revision, might be a newer minor or major...
110-
lowerBound = nextVersion(lastItem(lowerRange.getValue())).toString();
110+
lowerBound = nextVersion(lowerRange.getValue().getLast()).toString();
111111
} else {
112112
// a really old version we don't have a record for
113113
// assume it's an old version id - we can just return it directly
@@ -122,7 +122,7 @@ private static IntFunction<String> lookupFunction(NavigableMap<Integer, List<Ver
122122
var upperRange = versions.higherEntry(id);
123123
if (upperRange != null) {
124124
// too hard to guess what version this id might be for using the next version - just use it directly
125-
upperBound = upperRange.getValue().get(0).toString();
125+
upperBound = upperRange.getValue().getFirst().toString();
126126
} else {
127127
// a newer version than all we know about? Can't map it...
128128
upperBound = "[" + id + "]";
@@ -133,10 +133,6 @@ private static IntFunction<String> lookupFunction(NavigableMap<Integer, List<Ver
133133
};
134134
}
135135

136-
private static <T> T lastItem(List<T> list) {
137-
return list.get(list.size() - 1);
138-
}
139-
140136
private static Version nextVersion(Version version) {
141137
return new Version(version.id + 100); // +1 to revision
142138
}

server/src/main/java/org/elasticsearch/TransportVersions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static TransportVersion def(int id) {
173173
public static final TransportVersion INFERENCE_REQUEST_ADAPTIVE_RATE_LIMITING = def(8_839_0_00);
174174
public static final TransportVersion ML_INFERENCE_IBM_WATSONX_RERANK_ADDED = def(8_840_0_00);
175175
public static final TransportVersion ELASTICSEARCH_9_0 = def(9_000_0_00);
176-
176+
public static final TransportVersion COHERE_BIT_EMBEDDING_TYPE_SUPPORT_ADDED = def(9_001_0_00);
177177
/*
178178
* STOP! READ THIS FIRST! No, really,
179179
* ____ _____ ___ ____ _ ____ _____ _ ____ _____ _ _ ___ ____ _____ ___ ____ ____ _____ _

0 commit comments

Comments
 (0)