Skip to content

Commit cef677b

Browse files
authored
Merge branch 'main' into half_pushable
2 parents 093f89f + b78ac7c commit cef677b

File tree

104 files changed

+471
-996
lines changed

Some content is hidden

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

104 files changed

+471
-996
lines changed

.buildkite/pipelines/intake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ steps:
5656
timeout_in_minutes: 300
5757
matrix:
5858
setup:
59-
BWC_VERSION: ["8.17.7", "8.18.2", "8.19.0", "9.0.1", "9.1.0"]
59+
BWC_VERSION: ["8.17.7", "8.18.2", "8.19.0", "9.0.2", "9.1.0"]
6060
agents:
6161
provider: gcp
6262
image: family/elasticsearch-ubuntu-2004

.buildkite/pipelines/periodic-packaging.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ steps:
351351
env:
352352
BWC_VERSION: 8.19.0
353353

354-
- label: "{{matrix.image}} / 9.0.1 / packaging-tests-upgrade"
355-
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v9.0.1
354+
- label: "{{matrix.image}} / 9.0.2 / packaging-tests-upgrade"
355+
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v9.0.2
356356
timeout_in_minutes: 300
357357
matrix:
358358
setup:
@@ -365,7 +365,7 @@ steps:
365365
machineType: custom-16-32768
366366
buildDirectory: /dev/shm/bk
367367
env:
368-
BWC_VERSION: 9.0.1
368+
BWC_VERSION: 9.0.2
369369

370370
- label: "{{matrix.image}} / 9.1.0 / packaging-tests-upgrade"
371371
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v9.1.0

.buildkite/pipelines/periodic.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ steps:
382382
- signal_reason: agent_stop
383383
limit: 3
384384

385-
- label: 9.0.1 / bwc
386-
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v9.0.1#bwcTest
385+
- label: 9.0.2 / bwc
386+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v9.0.2#bwcTest
387387
timeout_in_minutes: 300
388388
agents:
389389
provider: gcp
@@ -392,7 +392,7 @@ steps:
392392
buildDirectory: /dev/shm/bk
393393
preemptible: true
394394
env:
395-
BWC_VERSION: 9.0.1
395+
BWC_VERSION: 9.0.2
396396
retry:
397397
automatic:
398398
- exit_status: "-1"
@@ -486,7 +486,7 @@ steps:
486486
setup:
487487
ES_RUNTIME_JAVA:
488488
- openjdk21
489-
BWC_VERSION: ["8.17.7", "8.18.2", "8.19.0", "9.0.1", "9.1.0"]
489+
BWC_VERSION: ["8.17.7", "8.18.2", "8.19.0", "9.0.2", "9.1.0"]
490490
agents:
491491
provider: gcp
492492
image: family/elasticsearch-ubuntu-2004
@@ -533,7 +533,7 @@ steps:
533533
ES_RUNTIME_JAVA:
534534
- openjdk21
535535
- openjdk23
536-
BWC_VERSION: ["8.17.7", "8.18.2", "8.19.0", "9.0.1", "9.1.0"]
536+
BWC_VERSION: ["8.17.7", "8.18.2", "8.19.0", "9.0.2", "9.1.0"]
537537
agents:
538538
provider: gcp
539539
image: family/elasticsearch-ubuntu-2004

.ci/bwcVersions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ BWC_VERSION:
1919
- "8.17.7"
2020
- "8.18.2"
2121
- "8.19.0"
22-
- "9.0.1"
22+
- "9.0.2"
2323
- "9.1.0"

.ci/snapshotBwcVersions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ BWC_VERSION:
22
- "8.17.7"
33
- "8.18.2"
44
- "8.19.0"
5-
- "9.0.1"
5+
- "9.0.2"
66
- "9.1.0"

build-tools/src/main/java/org/elasticsearch/gradle/plugin/BasePluginBuildPlugin.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,7 @@ private static CopySpec createBundleSpec(
183183
) {
184184
var bundleSpec = project.copySpec();
185185
bundleSpec.from(buildProperties);
186-
bundleSpec.from(pluginMetadata, copySpec -> {
187-
// metadata (eg custom security policy)
188-
// the codebases properties file is only for tests and not needed in production
189-
copySpec.exclude("plugin-security.codebases");
190-
});
186+
bundleSpec.from(pluginMetadata);
191187
bundleSpec.from(
192188
(Callable<TaskProvider<Task>>) () -> project.getPluginManager().hasPlugin("com.gradleup.shadow")
193189
? project.getTasks().named("shadowJar")

distribution/archives/integ-test-zip/src/javaRestTest/resources/plugin-security.policy

Lines changed: 0 additions & 4 deletions
This file was deleted.

distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/cli/InstallPluginAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ void jarHellCheck(PluginDescriptor candidateInfo, Path candidateDir, Path plugin
922922
private PluginDescriptor installPlugin(InstallablePlugin descriptor, Path tmpRoot, List<Path> deleteOnFailure) throws Exception {
923923
final PluginDescriptor info = loadPluginInfo(tmpRoot);
924924

925-
Path legacyPolicyFile = tmpRoot.resolve(PluginDescriptor.ES_PLUGIN_POLICY);
925+
Path legacyPolicyFile = tmpRoot.resolve("plugin-security.policy");
926926
if (Files.exists(legacyPolicyFile)) {
927927
terminal.errorPrintln(
928928
"WARNING: this plugin contains a legacy Security Policy file. Starting with version 8.18, "

docs/changelog/125694.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/changelog/126342.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/changelog/126605.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/changelog/126778.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/changelog/126876.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 126876
2+
summary: Improve HNSW filtered search speed through new heuristic
3+
area: Vector Search
4+
type: enhancement
5+
issues: []

docs/changelog/127414.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/changelog/127527.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/reference/elasticsearch/index-settings/index-modules.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,12 @@ $$$index-final-pipeline$$$
249249
$$$index-hidden$$$ `index.hidden`
250250
: Indicates whether the index should be hidden by default. Hidden indices are not returned by default when using a wildcard expression. This behavior is controlled per request through the use of the `expand_wildcards` parameter. Possible values are `true` and `false` (default).
251251

252+
$$$index-dense-vector-hnsw-filter-heuristic$$$ `index.dense_vector.hnsw_filter_heuristic`
253+
: The heuristic to utilize when executing a filtered search against vectors in an HNSW graph. This setting is in technical preview may be changed or removed in a future release. It can be set to:
254+
255+
* `acorn` (default) - Only vectors that match the filter criteria are searched. This is the fastest option, and generally provides faster searches at similar recall to `fanout`, but `num_candidates` might need to be increased for exceptionally high recall requirements.
256+
* `fanout` - All vectors are compared with the query vector, but only those passing the criteria are added to the search results. Can be slower than `acorn`, but may yield higher recall.
257+
252258
$$$index-esql-stored-fields-sequential-proportion$$$
253259

254260
`index.esql.stored_fields_sequential_proportion`

libs/core/src/test/java/org/elasticsearch/core/internal/provider/EmbeddedImplClassLoaderTests.java

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010
package org.elasticsearch.core.internal.provider;
1111

12+
import org.elasticsearch.core.IOUtils;
1213
import org.elasticsearch.core.Strings;
1314
import org.elasticsearch.core.SuppressForbidden;
1415
import org.elasticsearch.core.internal.provider.EmbeddedImplClassLoader.CompoundEnumeration;
1516
import org.elasticsearch.test.ESTestCase;
16-
import org.elasticsearch.test.PrivilegedOperations;
1717
import org.elasticsearch.test.compiler.InMemoryJavaCompiler;
1818
import org.elasticsearch.test.jar.JarUtils;
1919

@@ -195,13 +195,10 @@ private Object newFooBar(boolean enableMulti, int... versions) throws Exception
195195
Path outerJar = topLevelDir.resolve("impl.jar");
196196
JarUtils.createJarWithEntries(outerJar, jarEntries);
197197
URL[] urls = new URL[] { outerJar.toUri().toURL() };
198-
URLClassLoader parent = URLClassLoader.newInstance(urls, EmbeddedImplClassLoaderTests.class.getClassLoader());
199-
try {
198+
try (URLClassLoader parent = loader(urls)) {
200199
EmbeddedImplClassLoader loader = EmbeddedImplClassLoader.getInstance(parent, "x-foo");
201200
Class<?> c = loader.loadClass("p.FooBar");
202201
return c.getConstructor().newInstance();
203-
} finally {
204-
PrivilegedOperations.closeURLClassLoader(parent);
205202
}
206203
}
207204

@@ -245,8 +242,7 @@ public void testResourcesBasic() throws Exception {
245242
Path outerJar = topLevelDir.resolve("impl.jar");
246243
JarUtils.createJarWithEntriesUTF(outerJar, jarEntries);
247244
URL[] urls = new URL[] { outerJar.toUri().toURL() };
248-
URLClassLoader parent = URLClassLoader.newInstance(urls, EmbeddedImplClassLoaderTests.class.getClassLoader());
249-
try {
245+
try (URLClassLoader parent = loader(urls)) {
250246
EmbeddedImplClassLoader loader = EmbeddedImplClassLoader.getInstance(parent, "res");
251247
// resource in a valid java package dir
252248
URL url = loader.findResource("p/res.txt");
@@ -274,8 +270,6 @@ public void testResourcesBasic() throws Exception {
274270
hasToString(endsWith("impl.jar!/IMPL-JARS/res/zoo-impl.jar/A-C/res.txt"))
275271
)
276272
);
277-
} finally {
278-
PrivilegedOperations.closeURLClassLoader(parent);
279273
}
280274
}
281275

@@ -326,9 +320,7 @@ private void testResourcesParent(String resourcePath) throws Exception {
326320
containsInAnyOrder("Parent Resource", "Embedded Resource")
327321
);
328322
} finally {
329-
for (URLClassLoader closeable : closeables) {
330-
PrivilegedOperations.closeURLClassLoader(closeable);
331-
}
323+
IOUtils.close(closeables);
332324
}
333325
}
334326

@@ -463,9 +455,7 @@ private void testResourcesVersioned(String resourcePath, boolean enableMulti, in
463455
assertThat(new String(is.readAllBytes(), UTF_8), is("Hello World" + expectedVersion));
464456
}
465457
} finally {
466-
for (URLClassLoader closeable : closeables) {
467-
PrivilegedOperations.closeURLClassLoader(closeable);
468-
}
458+
IOUtils.close(closeables);
469459
}
470460
}
471461

@@ -493,8 +483,7 @@ public void testIDontHaveIt() throws Exception {
493483
Path outerJar = topLevelDir.resolve("impl.jar");
494484
JarUtils.createJarWithEntriesUTF(outerJar, jarEntries);
495485
URL[] urls = new URL[] { outerJar.toUri().toURL() };
496-
URLClassLoader parent = URLClassLoader.newInstance(urls, EmbeddedImplClassLoaderTests.class.getClassLoader());
497-
try {
486+
try (URLClassLoader parent = loader(urls)) {
498487
embedLoader = EmbeddedImplClassLoader.getInstance(parent, "res");
499488

500489
Class<?> c = embedLoader.loadClass("java.lang.Object");
@@ -514,8 +503,6 @@ public void testIDontHaveIt() throws Exception {
514503
expectThrows(NPE, () -> embedLoader.getResourceAsStream(null));
515504
expectThrows(NPE, () -> embedLoader.resources(null));
516505
expectThrows(NPE, () -> embedLoader.loadClass(null));
517-
} finally {
518-
PrivilegedOperations.closeURLClassLoader(parent);
519506
}
520507
}
521508

@@ -542,8 +529,7 @@ public void testLoadWithJarDependencies() throws Exception {
542529
JarUtils.createJarWithEntries(outerJar, jarEntries);
543530
URL[] urls = new URL[] { outerJar.toUri().toURL() };
544531

545-
URLClassLoader parent = URLClassLoader.newInstance(urls, EmbeddedImplClassLoaderTests.class.getClassLoader());
546-
try {
532+
try (URLClassLoader parent = loader(urls)) {
547533
EmbeddedImplClassLoader loader = EmbeddedImplClassLoader.getInstance(parent, "blah");
548534
Class<?> c = loader.loadClass("p.Foo");
549535
Object obj = c.getConstructor().newInstance();
@@ -555,8 +541,6 @@ public void testLoadWithJarDependencies() throws Exception {
555541
expectThrows(CNFE, () -> loader.loadClass("p.Unknown"));
556542
expectThrows(CNFE, () -> loader.loadClass("q.Unknown"));
557543
expectThrows(CNFE, () -> loader.loadClass("r.Unknown"));
558-
} finally {
559-
PrivilegedOperations.closeURLClassLoader(parent);
560544
}
561545
}
562546

@@ -577,18 +561,20 @@ public void testResourcesWithMultipleJars() throws Exception {
577561
Path outerJar = topLevelDir.resolve("impl.jar");
578562
JarUtils.createJarWithEntriesUTF(outerJar, jarEntries);
579563
URL[] urls = new URL[] { outerJar.toUri().toURL() };
580-
URLClassLoader parent = URLClassLoader.newInstance(urls, EmbeddedImplClassLoaderTests.class.getClassLoader());
581-
try {
564+
565+
try (URLClassLoader parent = loader(urls)) {
582566
EmbeddedImplClassLoader loader = EmbeddedImplClassLoader.getInstance(parent, "blah");
583567
var res = Collections.list(loader.getResources("res.txt"));
584568
assertThat(res, hasSize(3));
585569
List<String> l = res.stream().map(EmbeddedImplClassLoaderTests::urlToString).toList();
586570
assertThat(l, containsInAnyOrder("fooRes", "barRes", "bazRes"));
587-
} finally {
588-
PrivilegedOperations.closeURLClassLoader(parent);
589571
}
590572
}
591573

574+
private static URLClassLoader loader(URL[] urls) {
575+
return URLClassLoader.newInstance(urls, EmbeddedImplClassLoaderTests.class.getClassLoader());
576+
}
577+
592578
@SuppressForbidden(reason = "file urls")
593579
static String urlToString(URL url) {
594580
try {

libs/core/src/test/java/org/elasticsearch/core/internal/provider/ProviderLocatorTests.java

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
package org.elasticsearch.core.internal.provider;
1111

1212
import org.elasticsearch.test.ESTestCase;
13-
import org.elasticsearch.test.PrivilegedOperations;
1413
import org.elasticsearch.test.compiler.InMemoryJavaCompiler;
1514
import org.elasticsearch.test.jar.JarUtils;
1615

1716
import java.lang.module.ModuleDescriptor;
17+
import java.net.MalformedURLException;
1818
import java.net.URL;
1919
import java.net.URLClassLoader;
2020
import java.nio.file.Files;
@@ -117,12 +117,8 @@ public class FooIntSupplier implements java.util.function.IntSupplier {
117117
Path topLevelDir = createTempDir(getTestName());
118118
Path outerJar = topLevelDir.resolve("impl.jar");
119119
JarUtils.createJarWithEntries(outerJar, jarEntries);
120-
URLClassLoader parent = URLClassLoader.newInstance(
121-
new URL[] { outerJar.toUri().toURL() },
122-
ProviderLocatorTests.class.getClassLoader()
123-
);
124120

125-
try {
121+
try (URLClassLoader parent = loader(outerJar)) {
126122
// test scenario
127123
ProviderLocator<IntSupplier> locator = new ProviderLocator<>("x-foo", IntSupplier.class, parent, "x.foo.impl", Set.of(), true);
128124
IntSupplier impl = locator.get();
@@ -139,8 +135,6 @@ public class FooIntSupplier implements java.util.function.IntSupplier {
139135
assertThat(md.exports(), containsInAnyOrder(exportsOf("p")));
140136
assertThat(md.opens(), containsInAnyOrder(opensOf("q")));
141137
assertThat(md.packages(), containsInAnyOrder(equalTo("p"), equalTo("q"), equalTo("r")));
142-
} finally {
143-
PrivilegedOperations.closeURLClassLoader(parent);
144138
}
145139
}
146140

@@ -172,21 +166,15 @@ public class FooLongSupplier implements java.util.function.LongSupplier {
172166
Path topLevelDir = createTempDir(getTestName());
173167
Path outerJar = topLevelDir.resolve("impl.jar");
174168
JarUtils.createJarWithEntries(outerJar, jarEntries);
175-
URLClassLoader parent = URLClassLoader.newInstance(
176-
new URL[] { outerJar.toUri().toURL() },
177-
ProviderLocatorTests.class.getClassLoader()
178-
);
179169

180-
try {
170+
try (URLClassLoader parent = loader(outerJar)) {
181171
// test scenario
182172
ProviderLocator<LongSupplier> locator = new ProviderLocator<>("x-foo", LongSupplier.class, parent, "", Set.of(), false);
183173
LongSupplier impl = locator.get();
184174
assertThat(impl.getAsLong(), is(55L));
185175
assertThat(impl.toString(), equalTo("Hello from FooLongSupplier - non-modular!"));
186176
assertThat(impl.getClass().getName(), equalTo("p.FooLongSupplier"));
187177
assertThat(impl.getClass().getModule().isNamed(), is(false));
188-
} finally {
189-
PrivilegedOperations.closeURLClassLoader(parent);
190178
}
191179
}
192180

@@ -215,21 +203,18 @@ public class BarIntSupplier implements java.util.function.IntSupplier {
215203
Path pb = Files.createDirectories(barRoot.resolve("pb"));
216204
Files.write(pb.resolve("BarIntSupplier.class"), classToBytes.get("pb.BarIntSupplier"));
217205

218-
URLClassLoader parent = URLClassLoader.newInstance(
219-
new URL[] { topLevelDir.toUri().toURL() },
220-
ProviderLocatorTests.class.getClassLoader()
221-
);
222-
223-
try {
206+
try (URLClassLoader parent = loader(topLevelDir)) {
224207
// test scenario
225208
ProviderLocator<IntSupplier> locator = new ProviderLocator<>("y-bar", IntSupplier.class, parent, "", Set.of(), false);
226209
IntSupplier impl = locator.get();
227210
assertThat(impl.getAsInt(), is(42));
228211
assertThat(impl.toString(), equalTo("Hello from BarIntSupplier - exploded non-modular!"));
229212
assertThat(impl.getClass().getName(), equalTo("pb.BarIntSupplier"));
230213
assertThat(impl.getClass().getModule().isNamed(), is(false));
231-
} finally {
232-
PrivilegedOperations.closeURLClassLoader(parent);
233214
}
234215
}
216+
217+
private static URLClassLoader loader(Path jar) throws MalformedURLException {
218+
return URLClassLoader.newInstance(new URL[] { jar.toUri().toURL() }, ProviderLocatorTests.class.getClassLoader());
219+
}
235220
}

0 commit comments

Comments
 (0)