Skip to content

Commit 83c1895

Browse files
committed
Merge branch 'main' into ilm-retry-mp
2 parents 858f93c + f398265 commit 83c1895

File tree

54 files changed

+386
-185
lines changed

Some content is hidden

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

54 files changed

+386
-185
lines changed

modules/data-streams/src/main/java/org/elasticsearch/datastreams/action/TransportCreateDataStreamAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ protected void masterOperation(
8383

8484
@Override
8585
protected ClusterBlockException checkBlock(CreateDataStreamAction.Request request, ClusterState state) {
86-
return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_WRITE);
86+
return state.blocks().globalBlockedException(projectResolver.getProjectId(), ClusterBlockLevel.METADATA_WRITE);
8787
}
8888
}

modules/data-streams/src/main/java/org/elasticsearch/datastreams/action/TransportDeleteDataStreamAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,6 @@ static ClusterState removeDataStream(
161161

162162
@Override
163163
protected ClusterBlockException checkBlock(DeleteDataStreamAction.Request request, ClusterState state) {
164-
return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_WRITE);
164+
return state.blocks().globalBlockedException(projectResolver.getProjectId(), ClusterBlockLevel.METADATA_WRITE);
165165
}
166166
}

modules/data-streams/src/main/java/org/elasticsearch/datastreams/lifecycle/action/TransportGetDataStreamLifecycleAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,6 @@ protected void localClusterStateOperation(
122122

123123
@Override
124124
protected ClusterBlockException checkBlock(GetDataStreamLifecycleAction.Request request, ProjectState state) {
125-
return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_READ);
125+
return state.blocks().globalBlockedException(state.projectId(), ClusterBlockLevel.METADATA_READ);
126126
}
127127
}

muted-tests.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -547,21 +547,9 @@ tests:
547547
- class: org.elasticsearch.xpack.profiling.action.GetStatusActionIT
548548
method: testWaitsUntilResourcesAreCreated
549549
issue: https://github.com/elastic/elasticsearch/issues/129486
550-
- class: org.elasticsearch.xpack.ilm.TimeseriesMoveToStepIT
551-
method: testMoveToRolloverStep
552-
issue: https://github.com/elastic/elasticsearch/issues/129489
553-
- class: org.elasticsearch.xpack.ilm.TimeseriesMoveToStepIT
554-
method: testMoveToAllocateStep
555-
issue: https://github.com/elastic/elasticsearch/issues/129490
556-
- class: org.elasticsearch.xpack.ilm.actions.ShrinkActionIT
557-
method: testShrinkDuringSnapshot
558-
issue: https://github.com/elastic/elasticsearch/issues/129491
559550
- class: org.elasticsearch.xpack.security.PermissionsIT
560551
method: testWhenUserLimitedByOnlyAliasOfIndexCanWriteToIndexWhichWasRolledoverByILMPolicy
561552
issue: https://github.com/elastic/elasticsearch/issues/129481
562-
- class: org.elasticsearch.xpack.ilm.TimeSeriesLifecycleActionsIT
563-
method: testFullPolicy
564-
issue: https://github.com/elastic/elasticsearch/issues/129510
565553
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
566554
method: test {knn-function.KnnSearchWithKOption SYNC}
567555
issue: https://github.com/elastic/elasticsearch/issues/129512

server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/TransportDeleteStoredScriptAction.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.elasticsearch.cluster.ClusterState;
1818
import org.elasticsearch.cluster.block.ClusterBlockException;
1919
import org.elasticsearch.cluster.block.ClusterBlockLevel;
20+
import org.elasticsearch.cluster.project.ProjectResolver;
2021
import org.elasticsearch.cluster.service.ClusterService;
2122
import org.elasticsearch.common.util.concurrent.EsExecutors;
2223
import org.elasticsearch.injection.guice.Inject;
@@ -28,13 +29,15 @@
2829
public class TransportDeleteStoredScriptAction extends AcknowledgedTransportMasterNodeAction<DeleteStoredScriptRequest> {
2930

3031
public static final ActionType<AcknowledgedResponse> TYPE = new ActionType<>("cluster:admin/script/delete");
32+
private final ProjectResolver projectResolver;
3133

3234
@Inject
3335
public TransportDeleteStoredScriptAction(
3436
TransportService transportService,
3537
ClusterService clusterService,
3638
ThreadPool threadPool,
37-
ActionFilters actionFilters
39+
ActionFilters actionFilters,
40+
ProjectResolver projectResolver
3841
) {
3942
super(
4043
TYPE.name(),
@@ -45,6 +48,7 @@ public TransportDeleteStoredScriptAction(
4548
DeleteStoredScriptRequest::new,
4649
EsExecutors.DIRECT_EXECUTOR_SERVICE
4750
);
51+
this.projectResolver = projectResolver;
4852
}
4953

5054
@Override
@@ -59,7 +63,7 @@ protected void masterOperation(
5963

6064
@Override
6165
protected ClusterBlockException checkBlock(DeleteStoredScriptRequest request, ClusterState state) {
62-
return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_WRITE);
66+
return state.blocks().globalBlockedException(projectResolver.getProjectId(), ClusterBlockLevel.METADATA_WRITE);
6367
}
6468

6569
}

server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/TransportForceMergeAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ protected ShardsIterator shards(ClusterState clusterState, ForceMergeRequest req
119119

120120
@Override
121121
protected ClusterBlockException checkGlobalBlock(ClusterState state, ForceMergeRequest request) {
122-
return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_WRITE);
122+
return state.blocks().globalBlockedException(projectResolver.getProjectId(), ClusterBlockLevel.METADATA_WRITE);
123123
}
124124

125125
@Override

server/src/main/java/org/elasticsearch/action/admin/indices/readonly/TransportAddIndexBlockAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ protected void doExecute(Task task, AddIndexBlockRequest request, ActionListener
8787

8888
@Override
8989
protected ClusterBlockException checkBlock(AddIndexBlockRequest request, ClusterState state) {
90+
final ProjectMetadata projectMetadata = projectResolver.getProjectMetadata(state);
9091
if (request.getBlock().getBlock().levels().contains(ClusterBlockLevel.METADATA_WRITE)
91-
&& state.blocks().global(ClusterBlockLevel.METADATA_WRITE).isEmpty()) {
92+
&& state.blocks().global(projectMetadata.id(), ClusterBlockLevel.METADATA_WRITE).isEmpty()) {
9293
return null;
9394
}
94-
final ProjectMetadata projectMetadata = projectResolver.getProjectMetadata(state);
9595
return state.blocks()
9696
.indicesBlockedException(
9797
projectMetadata.id(),

server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/TransportUpdateSettingsAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ public TransportUpdateSettingsAction(
8585
@Override
8686
protected ClusterBlockException checkBlock(UpdateSettingsRequest request, ClusterState state) {
8787
// allow for dedicated changes to the metadata blocks, so we don't block those to allow to "re-enable" it
88-
ClusterBlockException globalBlock = state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_WRITE);
88+
ClusterBlockException globalBlock = state.blocks()
89+
.globalBlockedException(projectResolver.getProjectId(), ClusterBlockLevel.METADATA_WRITE);
8990
if (globalBlock != null) {
9091
return globalBlock;
9192
}

server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/TransportDeleteComponentTemplateAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public TransportDeleteComponentTemplateAction(
6565

6666
@Override
6767
protected ClusterBlockException checkBlock(Request request, ClusterState state) {
68-
return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_WRITE);
68+
return state.blocks().globalBlockedException(projectResolver.getProjectId(), ClusterBlockLevel.METADATA_WRITE);
6969
}
7070

7171
@Override

server/src/main/java/org/elasticsearch/action/admin/indices/template/delete/TransportDeleteComposableIndexTemplateAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public TransportDeleteComposableIndexTemplateAction(
6464

6565
@Override
6666
protected ClusterBlockException checkBlock(Request request, ClusterState state) {
67-
return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_WRITE);
67+
return state.blocks().globalBlockedException(projectResolver.getProjectId(), ClusterBlockLevel.METADATA_WRITE);
6868
}
6969

7070
@Override

0 commit comments

Comments
 (0)