Skip to content

Commit 5487cf8

Browse files
committed
Merge remote-tracking branch 'es/main' into synthetic_source_encode_arrays
2 parents 3d75e27 + 191f801 commit 5487cf8

File tree

23 files changed

+230
-177
lines changed

23 files changed

+230
-177
lines changed

docs/changelog/122653.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 122653
2+
summary: Knn vector rescoring to sort score docs
3+
area: Vector Search
4+
type: bug
5+
issues:
6+
- 119711

libs/entitlement/src/main/java/org/elasticsearch/entitlement/bootstrap/EntitlementBootstrap.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public record BootstrapArgs(
3838
Function<Class<?>, String> pluginResolver,
3939
Path[] dataDirs,
4040
Path configDir,
41-
Path tempDir
41+
Path tempDir,
42+
Path logsDir
4243
) {
4344
public BootstrapArgs {
4445
requireNonNull(pluginPolicies);
@@ -64,22 +65,24 @@ public static BootstrapArgs bootstrapArgs() {
6465
*
6566
* @param pluginPolicies a map holding policies for plugins (and modules), by plugin (or module) name.
6667
* @param pluginResolver a functor to map a Java Class to the plugin it belongs to (the plugin name).
67-
* @param dataDirs data directories for Elasticsearch
68-
* @param configDir the config directory for Elasticsearch
69-
* @param tempDir the temp directory for Elasticsearch
68+
* @param dataDirs data directories for Elasticsearch
69+
* @param configDir the config directory for Elasticsearch
70+
* @param tempDir the temp directory for Elasticsearch
71+
* @param logsDir the log directory for Elasticsearch
7072
*/
7173
public static void bootstrap(
7274
Map<String, Policy> pluginPolicies,
7375
Function<Class<?>, String> pluginResolver,
7476
Path[] dataDirs,
7577
Path configDir,
76-
Path tempDir
78+
Path tempDir,
79+
Path logsDir
7780
) {
7881
logger.debug("Loading entitlement agent");
7982
if (EntitlementBootstrap.bootstrapArgs != null) {
8083
throw new IllegalStateException("plugin data is already set");
8184
}
82-
EntitlementBootstrap.bootstrapArgs = new BootstrapArgs(pluginPolicies, pluginResolver, dataDirs, configDir, tempDir);
85+
EntitlementBootstrap.bootstrapArgs = new BootstrapArgs(pluginPolicies, pluginResolver, dataDirs, configDir, tempDir, logsDir);
8386
exportInitializationToAgent();
8487
loadAgent(findAgentJar());
8588
selfTest();

libs/entitlement/src/main/java/org/elasticsearch/entitlement/initialization/EntitlementInitialization.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ private static PolicyManager createPolicyManager() {
129129
EntitlementBootstrap.BootstrapArgs bootstrapArgs = EntitlementBootstrap.bootstrapArgs();
130130
Map<String, Policy> pluginPolicies = bootstrapArgs.pluginPolicies();
131131
var pathLookup = new PathLookup(bootstrapArgs.configDir(), bootstrapArgs.dataDirs(), bootstrapArgs.tempDir());
132+
Path logsDir = EntitlementBootstrap.bootstrapArgs().logsDir();
132133

133134
// TODO(ES-10031): Decide what goes in the elasticsearch default policy and extend it
134135
var serverPolicy = new Policy(
@@ -147,7 +148,10 @@ private static PolicyManager createPolicyManager() {
147148
new LoadNativeLibrariesEntitlement(),
148149
new ManageThreadsEntitlement(),
149150
new FilesEntitlement(
150-
List.of(FilesEntitlement.FileData.ofPath(EntitlementBootstrap.bootstrapArgs().tempDir(), READ_WRITE))
151+
List.of(
152+
FilesEntitlement.FileData.ofPath(EntitlementBootstrap.bootstrapArgs().tempDir(), READ_WRITE),
153+
FilesEntitlement.FileData.ofPath(EntitlementBootstrap.bootstrapArgs().logsDir(), READ_WRITE)
154+
)
151155
)
152156
)
153157
),

modules/transport-netty4/src/test/java/org/elasticsearch/transport/netty4/Netty4WriteThrottlingHandlerTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public void testThrottleLargeCompositeMessage() {
109109
Netty4WriteThrottlingHandler.MAX_BYTES_PER_WRITE * fullSizeChunks + extraChunkSize
110110
);
111111
int splitOffset = randomIntBetween(0, messageBytes.length);
112+
int lastChunkSizeOfTheFirstSplit = splitOffset % Netty4WriteThrottlingHandler.MAX_BYTES_PER_WRITE;
112113
final BytesReference message = CompositeBytesReference.of(
113114
new BytesArray(messageBytes, 0, splitOffset),
114115
new BytesArray(messageBytes, splitOffset, messageBytes.length - splitOffset)
@@ -120,7 +121,9 @@ public void testThrottleLargeCompositeMessage() {
120121
assertFalse(promise.isDone());
121122
embeddedChannel.flush();
122123
assertTrue(promise.isDone());
123-
assertThat(seen, hasSize(oneOf(fullSizeChunks, fullSizeChunks + 1)));
124+
// If the extra chunk size is greater than the last chunk size for the first half of the split, it means we will need to send
125+
// (extraChunkSize - lastChunkSizeOfTheFirstSplit) bytes as the very last chunk of the entire message.
126+
assertThat(seen, hasSize(oneOf(fullSizeChunks, fullSizeChunks + 1 + (extraChunkSize > lastChunkSizeOfTheFirstSplit ? 1 : 0))));
124127
assertTrue(capturingHandler.didWriteAfterThrottled);
125128
assertBufferEquals(Unpooled.compositeBuffer().addComponents(true, seen), message);
126129
}

muted-tests.yml

Lines changed: 62 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,6 @@ tests:
150150
issue: https://github.com/elastic/elasticsearch/issues/117740
151151
- class: org.elasticsearch.xpack.security.authc.ldap.MultiGroupMappingIT
152152
issue: https://github.com/elastic/elasticsearch/issues/119599
153-
- class: org.elasticsearch.search.profile.dfs.DfsProfilerIT
154-
method: testProfileDfs
155-
issue: https://github.com/elastic/elasticsearch/issues/119711
156153
- class: org.elasticsearch.multi_cluster.MultiClusterYamlTestSuiteIT
157154
issue: https://github.com/elastic/elasticsearch/issues/119983
158155
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
@@ -216,41 +213,14 @@ tests:
216213
- class: org.elasticsearch.action.search.SearchProgressActionListenerIT
217214
method: testSearchProgressWithQuery
218215
issue: https://github.com/elastic/elasticsearch/issues/120994
219-
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
220-
method: testSuggestProfilesWithName
221-
issue: https://github.com/elastic/elasticsearch/issues/121022
222-
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
223-
method: testProfileAPIsWhenIndexNotCreated
224-
issue: https://github.com/elastic/elasticsearch/issues/121096
225-
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
226-
method: testGetProfiles
227-
issue: https://github.com/elastic/elasticsearch/issues/121101
228-
- class: org.elasticsearch.xpack.security.authc.service.ServiceAccountSingleNodeTests
229-
method: testAuthenticateWithServiceFileToken
230-
issue: https://github.com/elastic/elasticsearch/issues/120988
231-
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
232-
method: testUpdateProfileData
233-
issue: https://github.com/elastic/elasticsearch/issues/121108
234216
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
235217
method: test {p0=nodes.stats/11_indices_metrics/indices mappings exact count test for indices level}
236218
issue: https://github.com/elastic/elasticsearch/issues/120950
237-
- class: org.elasticsearch.xpack.security.authc.jwt.JwtRealmSingleNodeTests
238-
method: testActivateProfileForJWT
239-
issue: https://github.com/elastic/elasticsearch/issues/120983
240-
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
241-
method: testProfileIndexAutoCreation
242-
issue: https://github.com/elastic/elasticsearch/issues/120987
243219
- class: org.elasticsearch.xpack.security.FileSettingsRoleMappingsRestartIT
244220
method: testFileSettingsReprocessedOnRestartWithoutVersionChange
245221
issue: https://github.com/elastic/elasticsearch/issues/120964
246-
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
247-
method: testGetUsersWithProfileUidWhenProfileIndexDoesNotExists
248-
issue: https://github.com/elastic/elasticsearch/issues/121179
249222
- class: org.elasticsearch.xpack.ml.integration.PyTorchModelIT
250223
issue: https://github.com/elastic/elasticsearch/issues/121165
251-
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
252-
method: testSetEnabled
253-
issue: https://github.com/elastic/elasticsearch/issues/121183
254224
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
255225
method: test {p0=transform/*}
256226
issue: https://github.com/elastic/elasticsearch/issues/120816
@@ -289,29 +259,8 @@ tests:
289259
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
290260
method: test {yaml=reference/snapshot-restore/apis/get-snapshot-api/line_751}
291261
issue: https://github.com/elastic/elasticsearch/issues/121345
292-
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
293-
method: testHasPrivileges
294-
issue: https://github.com/elastic/elasticsearch/issues/121346
295-
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
296-
method: testActivateProfile
297-
issue: https://github.com/elastic/elasticsearch/issues/121151
298262
- class: org.elasticsearch.test.rest.yaml.CcsCommonYamlTestSuiteIT
299263
issue: https://github.com/elastic/elasticsearch/issues/121407
300-
- class: org.elasticsearch.xpack.security.authc.jwt.JwtRealmSingleNodeTests
301-
method: testClientSecretRotation
302-
issue: https://github.com/elastic/elasticsearch/issues/120985
303-
- class: org.elasticsearch.xpack.security.authc.jwt.JwtRealmSingleNodeTests
304-
method: testGrantApiKeyForJWT
305-
issue: https://github.com/elastic/elasticsearch/issues/121039
306-
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
307-
method: testGetUsersWithProfileUid
308-
issue: https://github.com/elastic/elasticsearch/issues/121483
309-
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
310-
method: testSuggestProfilesWithHint
311-
issue: https://github.com/elastic/elasticsearch/issues/121116
312-
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
313-
method: testSuggestProfileWithData
314-
issue: https://github.com/elastic/elasticsearch/issues/121258
315264
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
316265
method: test {yaml=reference/cat/health/cat-health-no-timestamp-example}
317266
issue: https://github.com/elastic/elasticsearch/issues/121867
@@ -395,6 +344,68 @@ tests:
395344
issue: https://github.com/elastic/elasticsearch/issues/122566
396345
- class: org.elasticsearch.entitlement.qa.EntitlementsDeniedNonModularIT
397346
issue: https://github.com/elastic/elasticsearch/issues/122569
347+
- class: org.elasticsearch.entitlement.qa.EntitlementsAllowedIT
348+
issue: https://github.com/elastic/elasticsearch/issues/122680
349+
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
350+
method: test {yaml=reference/snapshot-restore/apis/get-snapshot-api/line_408}
351+
issue: https://github.com/elastic/elasticsearch/issues/122681
352+
- class: org.elasticsearch.xpack.autoscaling.storage.ReactiveStorageIT
353+
method: testScaleWhileShrinking
354+
issue: https://github.com/elastic/elasticsearch/issues/122119
355+
- class: org.elasticsearch.lucene.RollingUpgradeLuceneIndexCompatibilityTestCase
356+
method: testIndexUpgrade {p0=[9.1.0, 8.19.0, 8.19.0]}
357+
issue: https://github.com/elastic/elasticsearch/issues/122688
358+
- class: org.elasticsearch.lucene.RollingUpgradeLuceneIndexCompatibilityTestCase
359+
method: testRestoreIndex {p0=[9.1.0, 9.1.0, 8.19.0]}
360+
issue: https://github.com/elastic/elasticsearch/issues/122689
361+
- class: org.elasticsearch.lucene.RollingUpgradeLuceneIndexCompatibilityTestCase
362+
method: testClosedIndexUpgrade {p0=[9.1.0, 8.19.0, 8.19.0]}
363+
issue: https://github.com/elastic/elasticsearch/issues/122690
364+
- class: org.elasticsearch.lucene.RollingUpgradeLuceneIndexCompatibilityTestCase
365+
method: testRestoreIndex {p0=[9.1.0, 8.19.0, 8.19.0]}
366+
issue: https://github.com/elastic/elasticsearch/issues/122691
367+
- class: org.elasticsearch.xpack.searchablesnapshots.FrozenSearchableSnapshotsIntegTests
368+
method: testCreateAndRestorePartialSearchableSnapshot
369+
issue: https://github.com/elastic/elasticsearch/issues/122693
370+
- class: org.elasticsearch.lucene.RollingUpgradeLuceneIndexCompatibilityTestCase
371+
method: testClosedIndexUpgrade {p0=[9.1.0, 9.1.0, 8.19.0]}
372+
issue: https://github.com/elastic/elasticsearch/issues/122694
373+
- class: org.elasticsearch.lucene.RollingUpgradeLuceneIndexCompatibilityTestCase
374+
method: testClosedIndexUpgrade {p0=[9.1.0, 9.1.0, 9.1.0]}
375+
issue: https://github.com/elastic/elasticsearch/issues/122695
376+
- class: org.elasticsearch.lucene.RollingUpgradeLuceneIndexCompatibilityTestCase
377+
method: testIndexUpgrade {p0=[9.1.0, 9.1.0, 8.19.0]}
378+
issue: https://github.com/elastic/elasticsearch/issues/122696
379+
- class: org.elasticsearch.lucene.RollingUpgradeLuceneIndexCompatibilityTestCase
380+
method: testIndexUpgrade {p0=[9.1.0, 9.1.0, 9.1.0]}
381+
issue: https://github.com/elastic/elasticsearch/issues/122697
382+
- class: org.elasticsearch.lucene.RollingUpgradeLuceneIndexCompatibilityTestCase
383+
method: testRestoreIndex {p0=[9.1.0, 9.1.0, 9.1.0]}
384+
issue: https://github.com/elastic/elasticsearch/issues/122698
385+
- class: org.elasticsearch.lucene.RollingUpgradeSearchableSnapshotIndexCompatibilityIT
386+
method: testSearchableSnapshotUpgrade {p0=[9.1.0, 8.19.0, 8.19.0]}
387+
issue: https://github.com/elastic/elasticsearch/issues/122700
388+
- class: org.elasticsearch.lucene.RollingUpgradeSearchableSnapshotIndexCompatibilityIT
389+
method: testSearchableSnapshotUpgrade {p0=[9.1.0, 9.1.0, 8.19.0]}
390+
issue: https://github.com/elastic/elasticsearch/issues/122701
391+
- class: org.elasticsearch.lucene.RollingUpgradeSearchableSnapshotIndexCompatibilityIT
392+
method: testMountSearchableSnapshot {p0=[9.1.0, 8.19.0, 8.19.0]}
393+
issue: https://github.com/elastic/elasticsearch/issues/122702
394+
- class: org.elasticsearch.lucene.RollingUpgradeSearchableSnapshotIndexCompatibilityIT
395+
method: testMountSearchableSnapshot {p0=[9.1.0, 9.1.0, 8.19.0]}
396+
issue: https://github.com/elastic/elasticsearch/issues/122703
397+
- class: org.elasticsearch.lucene.RollingUpgradeSearchableSnapshotIndexCompatibilityIT
398+
method: testSearchableSnapshotUpgrade {p0=[9.1.0, 9.1.0, 9.1.0]}
399+
issue: https://github.com/elastic/elasticsearch/issues/122704
400+
- class: org.elasticsearch.lucene.RollingUpgradeSearchableSnapshotIndexCompatibilityIT
401+
method: testMountSearchableSnapshot {p0=[9.1.0, 9.1.0, 9.1.0]}
402+
issue: https://github.com/elastic/elasticsearch/issues/122705
403+
- class: org.elasticsearch.search.basic.SearchWithRandomDisconnectsIT
404+
method: testSearchWithRandomDisconnects
405+
issue: https://github.com/elastic/elasticsearch/issues/122707
406+
- class: org.elasticsearch.indices.recovery.IndexRecoveryIT
407+
method: testSourceThrottling
408+
issue: https://github.com/elastic/elasticsearch/issues/122712
398409

399410
# Examples:
400411
#

server/src/internalClusterTest/java/org/elasticsearch/cluster/PrevalidateNodeRemovalIT.java

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -179,28 +179,35 @@ public void testNodeRemovalFromRedClusterWithTimeout() throws Exception {
179179
// make it red!
180180
internalCluster().stopNode(node1);
181181
ensureRed(indexName);
182+
CountDownLatch stallPrevalidateShardPathActionLatch = new CountDownLatch(1);
182183
MockTransportService.getInstance(node2)
183184
.addRequestHandlingBehavior(TransportPrevalidateShardPathAction.ACTION_NAME + "[n]", (handler, request, channel, task) -> {
184185
logger.info("drop the check shards request");
186+
safeAwait(stallPrevalidateShardPathActionLatch);
187+
handler.messageReceived(request, channel, task);
185188
});
186-
PrevalidateNodeRemovalRequest req = PrevalidateNodeRemovalRequest.builder()
187-
.setNames(node2)
188-
.build(TEST_REQUEST_TIMEOUT)
189-
.masterNodeTimeout(TimeValue.timeValueSeconds(1))
190-
.timeout(TimeValue.timeValueSeconds(1));
191-
PrevalidateNodeRemovalResponse resp = client().execute(PrevalidateNodeRemovalAction.INSTANCE, req).get();
192-
assertFalse("prevalidation result should return false", resp.getPrevalidation().isSafe());
193-
String node2Id = getNodeId(node2);
194-
assertThat(
195-
resp.getPrevalidation().message(),
196-
equalTo("cannot prevalidate removal of nodes with the following IDs: [" + node2Id + "]")
197-
);
198-
assertThat(resp.getPrevalidation().nodes().size(), equalTo(1));
199-
NodesRemovalPrevalidation.NodeResult nodeResult = resp.getPrevalidation().nodes().get(0);
200-
assertThat(nodeResult.name(), equalTo(node2));
201-
assertFalse(nodeResult.result().isSafe());
202-
assertThat(nodeResult.result().message(), startsWith("failed contacting the node"));
203-
assertThat(nodeResult.result().reason(), equalTo(NodesRemovalPrevalidation.Reason.UNABLE_TO_VERIFY));
189+
try {
190+
PrevalidateNodeRemovalRequest req = PrevalidateNodeRemovalRequest.builder()
191+
.setNames(node2)
192+
.build(TEST_REQUEST_TIMEOUT)
193+
.masterNodeTimeout(TimeValue.timeValueSeconds(1))
194+
.timeout(TimeValue.timeValueSeconds(1));
195+
PrevalidateNodeRemovalResponse resp = client().execute(PrevalidateNodeRemovalAction.INSTANCE, req).get();
196+
assertFalse("prevalidation result should return false", resp.getPrevalidation().isSafe());
197+
String node2Id = getNodeId(node2);
198+
assertThat(
199+
resp.getPrevalidation().message(),
200+
equalTo("cannot prevalidate removal of nodes with the following IDs: [" + node2Id + "]")
201+
);
202+
assertThat(resp.getPrevalidation().nodes().size(), equalTo(1));
203+
NodesRemovalPrevalidation.NodeResult nodeResult = resp.getPrevalidation().nodes().get(0);
204+
assertThat(nodeResult.name(), equalTo(node2));
205+
assertFalse(nodeResult.result().isSafe());
206+
assertThat(nodeResult.result().message(), startsWith("failed contacting the node"));
207+
assertThat(nodeResult.result().reason(), equalTo(NodesRemovalPrevalidation.Reason.UNABLE_TO_VERIFY));
208+
} finally {
209+
stallPrevalidateShardPathActionLatch.countDown();
210+
}
204211
}
205212

206213
private void ensureRed(String indexName) throws Exception {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ static TransportVersion def(int id) {
176176
public static final TransportVersion ML_INFERENCE_IBM_WATSONX_RERANK_ADDED = def(8_840_0_00);
177177
public static final TransportVersion COHERE_BIT_EMBEDDING_TYPE_SUPPORT_ADDED_BACKPORT_8_X = def(8_840_0_01);
178178
public static final TransportVersion REMOVE_ALL_APPLICABLE_SELECTOR_BACKPORT_8_X = def(8_840_0_02);
179+
public static final TransportVersion ESQL_RETRY_ON_SHARD_LEVEL_FAILURE_BACKPORT_8_19 = def(8_840_0_03);
180+
public static final TransportVersion ESQL_SUPPORT_PARTIAL_RESULTS_BACKPORT_8_19 = def(8_840_0_04);
179181
public static final TransportVersion ELASTICSEARCH_9_0 = def(9_000_0_00);
180182
public static final TransportVersion REMOVE_SNAPSHOT_FAILURES_90 = def(9_000_0_01);
181183
public static final TransportVersion TRANSPORT_STATS_HANDLING_TIME_REQUIRED_90 = def(9_000_0_02);

server/src/main/java/org/elasticsearch/action/search/CanMatchPreFilterSearchPhase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ public CanMatchNodeRequest.Shard buildShardLevelRequest(SearchShardIterator shar
387387
}
388388

389389
public void start() {
390-
if (shardsIts.size() == 0) {
390+
if (shardsIts.isEmpty()) {
391391
finishPhase();
392392
return;
393393
}

server/src/main/java/org/elasticsearch/action/search/SearchShardIterator.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import org.elasticsearch.action.OriginalIndices;
1313
import org.elasticsearch.cluster.routing.ShardRouting;
14-
import org.elasticsearch.cluster.routing.ShardsIterator;
1514
import org.elasticsearch.common.util.PlainIterator;
1615
import org.elasticsearch.core.Nullable;
1716
import org.elasticsearch.core.TimeValue;
@@ -113,15 +112,6 @@ SearchShardTarget nextOrNull() {
113112
return null;
114113
}
115114

116-
/**
117-
* Return the number of shards remaining in this {@link ShardsIterator}
118-
*
119-
* @return number of shard remaining
120-
*/
121-
int remaining() {
122-
return targetNodesIterator.remaining();
123-
}
124-
125115
/**
126116
* Returns a non-null value if this request should use a specific search context instead of the latest one.
127117
*/

0 commit comments

Comments
 (0)