Skip to content

Commit a720ca0

Browse files
authored
Merge branch '8.x' into release-notes-fp-8-17-2-8-x
2 parents d99cc6d + c0613cb commit a720ca0

File tree

12 files changed

+251
-166
lines changed

12 files changed

+251
-166
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import org.elasticsearch.core.Tuple;
3939
import org.elasticsearch.env.Environment;
4040
import org.elasticsearch.jdk.JarHell;
41+
import org.elasticsearch.jdk.RuntimeVersionFeature;
4142
import org.elasticsearch.plugin.scanner.ClassReaders;
4243
import org.elasticsearch.plugin.scanner.NamedComponentScanner;
4344
import org.elasticsearch.plugins.Platforms;
@@ -922,10 +923,12 @@ void jarHellCheck(PluginDescriptor candidateInfo, Path candidateDir, Path plugin
922923
*/
923924
private PluginDescriptor installPlugin(InstallablePlugin descriptor, Path tmpRoot, List<Path> deleteOnFailure) throws Exception {
924925
final PluginDescriptor info = loadPluginInfo(tmpRoot);
925-
PluginPolicyInfo pluginPolicy = PolicyUtil.getPluginPolicyInfo(tmpRoot, env.tmpDir());
926-
if (pluginPolicy != null) {
927-
Set<String> permissions = PluginSecurity.getPermissionDescriptions(pluginPolicy, env.tmpDir());
928-
PluginSecurity.confirmPolicyExceptions(terminal, permissions, batch);
926+
if (RuntimeVersionFeature.isSecurityManagerAvailable()) {
927+
PluginPolicyInfo pluginPolicy = PolicyUtil.getPluginPolicyInfo(tmpRoot, env.tmpDir());
928+
if (pluginPolicy != null) {
929+
Set<String> permissions = PluginSecurity.getPermissionDescriptions(pluginPolicy, env.tmpDir());
930+
PluginSecurity.confirmPolicyExceptions(terminal, permissions, batch);
931+
}
929932
}
930933

931934
// Validate that the downloaded plugin's ID matches what we expect from the descriptor. The

docs/changelog/122047.yaml

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

docs/changelog/122278.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 122278
2+
summary: Fix serialising the inference update request
3+
area: Machine Learning
4+
type: bug
5+
issues: []

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,3 @@ tests:
576576
- class: org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT
577577
method: test {date_nanos.Bucket Date nanos by 10 minutes SYNC}
578578
issue: https://github.com/elastic/elasticsearch/issues/122273
579-
- class: org.elasticsearch.test.rest.ClientYamlTestSuiteIT
580-
method: test {yaml=snapshot.delete/10_basic/Delete a snapshot asynchronously}
581-
issue: https://github.com/elastic/elasticsearch/issues/122102

server/src/internalClusterTest/java/org/elasticsearch/snapshots/RepositoriesIT.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -508,12 +508,6 @@ public void taskSucceeded(ClusterStateTaskListener clusterStateTaskListener, Obj
508508
.orElseThrow()
509509
.queue();
510510

511-
// There is one task in the queue for computing and forking the cleanup work.
512-
assertThat(queueLength.getAsInt(), equalTo(1));
513-
514-
safeAwait(barrier); // unblock the barrier thread and let it process the queue
515-
safeAwait(barrier); // wait for the queue to be processed
516-
517511
// There are indexCount (=3*snapshotPoolSize) index-deletion tasks, plus one for cleaning up the root metadata. However, the
518512
// throttled runner only enqueues one task per SNAPSHOT thread to start with, and then the eager runner adds another one. This shows
519513
// we are not spamming the threadpool with all the tasks at once, which means that other snapshot activities can run alongside this

server/src/main/java/org/elasticsearch/repositories/RepositoryData.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.elasticsearch.snapshots.SnapshotInfo;
3030
import org.elasticsearch.snapshots.SnapshotState;
3131
import org.elasticsearch.snapshots.SnapshotsService;
32-
import org.elasticsearch.threadpool.ThreadPool;
3332
import org.elasticsearch.xcontent.XContentBuilder;
3433
import org.elasticsearch.xcontent.XContentParser;
3534

@@ -378,7 +377,6 @@ private static boolean isIndexToUpdateAfterRemovingSnapshots(
378377
* @return map of index to index metadata blob id to delete
379378
*/
380379
public Map<IndexId, Collection<String>> indexMetaDataToRemoveAfterRemovingSnapshots(Collection<SnapshotId> snapshotIds) {
381-
assert ThreadPool.assertCurrentThreadPool(ThreadPool.Names.SNAPSHOT);
382380
Iterator<IndexId> indicesForSnapshot = indicesToUpdateAfterRemovingSnapshot(snapshotIds);
383381
final Set<String> allRemainingIdentifiers = indexMetaDataGenerations.lookup.entrySet()
384382
.stream()

server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,20 +1129,14 @@ private void runWithUniqueShardMetadataNaming(ActionListener<RepositoryData> rep
11291129
);
11301130
})
11311131

1132-
.<RepositoryData>andThen(
1133-
// writeIndexGen finishes on master-service thread so must fork here.
1134-
snapshotExecutor,
1135-
threadPool.getThreadContext(),
1136-
(l, newRepositoryData) -> {
1137-
l.onResponse(newRepositoryData);
1138-
// Once we have updated the repository, run the unreferenced blobs cleanup in parallel to shard-level snapshot
1139-
// deletion
1140-
try (var refs = new RefCountingRunnable(onCompletion)) {
1141-
cleanupUnlinkedRootAndIndicesBlobs(newRepositoryData, refs.acquireListener());
1142-
cleanupUnlinkedShardLevelBlobs(refs.acquireListener());
1143-
}
1132+
.<RepositoryData>andThen((l, newRepositoryData) -> {
1133+
l.onResponse(newRepositoryData);
1134+
// Once we have updated the repository, run the unreferenced blobs cleanup in parallel to shard-level snapshot deletion
1135+
try (var refs = new RefCountingRunnable(onCompletion)) {
1136+
cleanupUnlinkedRootAndIndicesBlobs(newRepositoryData, refs.acquireListener());
1137+
cleanupUnlinkedShardLevelBlobs(refs.acquireListener());
11441138
}
1145-
)
1139+
})
11461140

11471141
.addListener(repositoryDataUpdateListener);
11481142
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/action/UpdateInferenceModelAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ public Request(String inferenceEntityId, BytesReference content, XContentType co
7070
public Request(StreamInput in) throws IOException {
7171
super(in);
7272
this.inferenceEntityId = in.readString();
73-
this.content = in.readBytesReference();
7473
this.taskType = TaskType.fromStream(in);
74+
this.content = in.readBytesReference();
7575
this.contentType = in.readEnum(XContentType.class);
7676
}
7777

0 commit comments

Comments
 (0)