Skip to content

Commit e37863f

Browse files
committed
Merge branch 'main' into 2025/03/07/limit-string-collection-length-util
2 parents 02d661d + 74bb0f9 commit e37863f

File tree

63 files changed

+416
-331
lines changed

Some content is hidden

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

63 files changed

+416
-331
lines changed

docs/changelog/123890.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 123890
2+
summary: Do not let `ShardBulkInferenceActionFilter` unwrap / rewrap ESExceptions
3+
area: Search
4+
type: bug
5+
issues: []

libs/entitlement/bridge/src/main/java/org/elasticsearch/entitlement/bridge/EntitlementChecker.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,10 +518,7 @@ public interface EntitlementChecker {
518518
Class<?>[] classes
519519
);
520520

521-
void check$sun_net_www_protocol_https_AbstractDelegateHttpsURLConnection$connect(
522-
Class<?> callerClass,
523-
javax.net.ssl.HttpsURLConnection that
524-
);
521+
void check$sun_net_www_protocol_https_AbstractDelegateHttpsURLConnection$connect(Class<?> callerClass, java.net.HttpURLConnection that);
525522

526523
void check$sun_net_www_protocol_mailto_MailToURLConnection$connect(Class<?> callerClass, java.net.URLConnection that);
527524

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/api/ElasticsearchEntitlementChecker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ private static boolean isFileUrlConnection(java.net.URLConnection urlConnection)
11801180
@Override
11811181
public void check$sun_net_www_protocol_https_AbstractDelegateHttpsURLConnection$connect(
11821182
Class<?> callerClass,
1183-
javax.net.ssl.HttpsURLConnection that
1183+
java.net.HttpURLConnection that
11841184
) {
11851185
policyManager.checkOutboundNetworkAccess(callerClass);
11861186
}

modules/repository-s3/src/test/java/org/elasticsearch/repositories/s3/RepositoryCredentialsTests.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@ public void testRepositoryCredentialsOverrideSecureCredentials() {
107107
assertThat(credentials.getAWSSecretKey(), is("insecure_aws_secret"));
108108

109109
assertCriticalWarnings(
110-
"[access_key] setting was deprecated in Elasticsearch and will be removed in a future release.",
111-
"[secret_key] setting was deprecated in Elasticsearch and will be removed in a future release.",
110+
"[access_key] setting was deprecated in Elasticsearch and will be removed in a future release. "
111+
+ "See the breaking changes documentation for the next major version.",
112+
"[secret_key] setting was deprecated in Elasticsearch and will be removed in a future release. "
113+
+ "See the breaking changes documentation for the next major version.",
112114
S3Repository.INSECURE_CREDENTIALS_DEPRECATION_WARNING
113115
);
114116
}
@@ -193,8 +195,10 @@ public void testReinitSecureCredentials() {
193195

194196
if (hasInsecureSettings) {
195197
assertCriticalWarnings(
196-
"[access_key] setting was deprecated in Elasticsearch and will be removed in a future release.",
197-
"[secret_key] setting was deprecated in Elasticsearch and will be removed in a future release.",
198+
"[access_key] setting was deprecated in Elasticsearch and will be removed in a future release. "
199+
+ "See the breaking changes documentation for the next major version.",
200+
"[secret_key] setting was deprecated in Elasticsearch and will be removed in a future release. "
201+
+ "See the breaking changes documentation for the next major version.",
198202
S3Repository.INSECURE_CREDENTIALS_DEPRECATION_WARNING
199203
);
200204
}

muted-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,9 @@ tests:
345345
- class: org.elasticsearch.search.fieldcaps.FieldCapabilitiesIT
346346
method: testRelocation
347347
issue: https://github.com/elastic/elasticsearch/issues/124227
348+
- class: org.elasticsearch.smoketest.MlWithSecurityIT
349+
method: test {yaml=ml/3rd_party_deployment/Test start and stop multiple deployments}
350+
issue: https://github.com/elastic/elasticsearch/issues/124315
348351

349352
# Examples:
350353
#

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1842,7 +1842,7 @@ private enum ElasticsearchExceptionHandle {
18421842
org.elasticsearch.ElasticsearchAuthenticationProcessingError.class,
18431843
org.elasticsearch.ElasticsearchAuthenticationProcessingError::new,
18441844
162,
1845-
TransportVersions.V_7_16_0
1845+
UNKNOWN_VERSION_ADDED
18461846
),
18471847
REPOSITORY_CONFLICT_EXCEPTION(
18481848
org.elasticsearch.repositories.RepositoryConflictException.class,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ static TransportVersion def(int id) {
6262
public static final TransportVersion V_7_10_0 = def(7_10_00_99);
6363
public static final TransportVersion V_7_15_0 = def(7_15_00_99);
6464
public static final TransportVersion V_7_15_1 = def(7_15_01_99);
65-
public static final TransportVersion V_7_16_0 = def(7_16_00_99);
6665
public static final TransportVersion V_7_17_0 = def(7_17_00_99);
6766
public static final TransportVersion V_7_17_1 = def(7_17_01_99);
6867
public static final TransportVersion V_7_17_8 = def(7_17_08_99);

server/src/main/java/org/elasticsearch/action/admin/indices/rollover/LazyRolloverAction.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ public ClusterState executeTask(
268268

269269
final var rolloverIndexName = rolloverResult.rolloverIndexName();
270270
final var sourceIndexName = rolloverResult.sourceIndexName();
271+
logger.info(
272+
"rolling over data stream [{}] to index [{}] because it was marked for lazy rollover",
273+
dataStream.getName(),
274+
rolloverIndexName
275+
);
271276

272277
final var waitForActiveShardsTimeout = rolloverRequest.masterNodeTimeout().millis() < 0
273278
? null

server/src/main/java/org/elasticsearch/action/admin/indices/rollover/TransportRolloverAction.java

Lines changed: 63 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -221,45 +221,17 @@ protected void masterOperation(
221221
final String trialRolloverIndexName = trialRolloverNames.rolloverName();
222222
MetadataCreateIndexService.validateIndexName(trialRolloverIndexName, projectMetadata, projectState.routingTable());
223223

224-
boolean isDataStream = projectMetadata.dataStreams().containsKey(resolvedRolloverTarget.resource());
225224
if (rolloverRequest.isLazy()) {
226-
if (isDataStream == false || rolloverRequest.getConditions().hasConditions()) {
227-
String message;
228-
if (isDataStream) {
229-
message = "Lazy rollover can be used only without any conditions."
230-
+ " Please remove the conditions from the request body or the query parameter 'lazy'.";
231-
} else if (rolloverRequest.getConditions().hasConditions() == false) {
232-
message = "Lazy rollover can be applied only on a data stream." + " Please remove the query parameter 'lazy'.";
233-
} else {
234-
message = "Lazy rollover can be applied only on a data stream with no conditions."
235-
+ " Please remove the query parameter 'lazy'.";
236-
}
237-
listener.onFailure(new IllegalArgumentException(message));
238-
return;
239-
}
240-
if (rolloverRequest.isDryRun() == false) {
241-
metadataDataStreamsService.setRolloverOnWrite(
242-
projectState.projectId(),
243-
resolvedRolloverTarget.resource(),
244-
true,
245-
targetFailureStore,
246-
rolloverRequest.ackTimeout(),
247-
rolloverRequest.masterNodeTimeout(),
248-
listener.map(
249-
response -> new RolloverResponse(
250-
trialSourceIndexName,
251-
trialRolloverIndexName,
252-
Map.of(),
253-
false,
254-
false,
255-
response.isAcknowledged(),
256-
false,
257-
response.isAcknowledged()
258-
)
259-
)
260-
);
261-
return;
262-
}
225+
markForLazyRollover(
226+
rolloverRequest,
227+
listener,
228+
projectMetadata,
229+
resolvedRolloverTarget,
230+
targetFailureStore,
231+
trialSourceIndexName,
232+
trialRolloverIndexName
233+
);
234+
return;
263235
}
264236

265237
final IndexAbstraction rolloverTargetAbstraction = projectMetadata.getIndicesLookup().get(resolvedRolloverTarget.resource());
@@ -353,7 +325,7 @@ protected void masterOperation(
353325
false,
354326
false,
355327
false,
356-
rolloverRequest.isLazy()
328+
false
357329
);
358330

359331
// If this is a dry run, return with the results without invoking a cluster state update
@@ -382,6 +354,58 @@ protected void masterOperation(
382354
);
383355
}
384356

357+
private void markForLazyRollover(
358+
RolloverRequest rolloverRequest,
359+
ActionListener<RolloverResponse> listener,
360+
ProjectMetadata projectMetadata,
361+
ResolvedExpression resolvedRolloverTarget,
362+
boolean targetFailureStore,
363+
String trialSourceIndexName,
364+
String trialRolloverIndexName
365+
) {
366+
boolean isDataStream = projectMetadata.dataStreams().containsKey(resolvedRolloverTarget.resource());
367+
if (isDataStream == false || rolloverRequest.getConditions().hasConditions()) {
368+
String message;
369+
if (isDataStream) {
370+
message = "Lazy rollover can be used only without any conditions."
371+
+ " Please remove the conditions from the request body or the query parameter 'lazy'.";
372+
} else if (rolloverRequest.getConditions().hasConditions() == false) {
373+
message = "Lazy rollover can be applied only on a data stream. Please remove the query parameter 'lazy'.";
374+
} else {
375+
message = "Lazy rollover can be applied only on a data stream with no conditions."
376+
+ " Please remove the query parameter 'lazy'.";
377+
}
378+
listener.onFailure(new IllegalArgumentException(message));
379+
return;
380+
}
381+
if (rolloverRequest.isDryRun()) {
382+
listener.onResponse(
383+
new RolloverResponse(trialSourceIndexName, trialRolloverIndexName, Map.of(), true, false, false, false, true)
384+
);
385+
return;
386+
}
387+
metadataDataStreamsService.setRolloverOnWrite(
388+
projectMetadata.id(),
389+
resolvedRolloverTarget.resource(),
390+
true,
391+
targetFailureStore,
392+
rolloverRequest.ackTimeout(),
393+
rolloverRequest.masterNodeTimeout(),
394+
listener.map(
395+
response -> new RolloverResponse(
396+
trialSourceIndexName,
397+
trialRolloverIndexName,
398+
Map.of(),
399+
false,
400+
false,
401+
response.isAcknowledged(),
402+
false,
403+
true
404+
)
405+
)
406+
);
407+
}
408+
385409
private void initializeFailureStore(
386410
ProjectId projectId,
387411
RolloverRequest rolloverRequest,

server/src/main/java/org/elasticsearch/cluster/metadata/ShutdownShardMigrationStatus.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
package org.elasticsearch.cluster.metadata;
1111

12-
import org.elasticsearch.TransportVersion;
1312
import org.elasticsearch.TransportVersions;
1413
import org.elasticsearch.cluster.routing.allocation.ShardAllocationDecision;
1514
import org.elasticsearch.common.Strings;
@@ -33,7 +32,6 @@
3332
import static org.elasticsearch.common.xcontent.ChunkedToXContentHelper.startObject;
3433

3534
public class ShutdownShardMigrationStatus implements Writeable, ChunkedToXContentObject {
36-
private static final TransportVersion ALLOCATION_DECISION_ADDED_VERSION = TransportVersions.V_7_16_0;
3735

3836
public static final String NODE_ALLOCATION_DECISION_KEY = "node_allocation_decision";
3937

@@ -142,11 +140,7 @@ public ShutdownShardMigrationStatus(StreamInput in) throws IOException {
142140
this.shardsRemaining = in.readLong();
143141
}
144142
this.explanation = in.readOptionalString();
145-
if (in.getTransportVersion().onOrAfter(ALLOCATION_DECISION_ADDED_VERSION)) {
146-
this.allocationDecision = in.readOptionalWriteable(ShardAllocationDecision::new);
147-
} else {
148-
this.allocationDecision = null;
149-
}
143+
this.allocationDecision = in.readOptionalWriteable(ShardAllocationDecision::new);
150144
}
151145

152146
public long getShardsRemaining() {
@@ -203,9 +197,7 @@ public void writeTo(StreamOutput out) throws IOException {
203197
out.writeLong(shardsRemaining);
204198
}
205199
out.writeOptionalString(explanation);
206-
if (out.getTransportVersion().onOrAfter(ALLOCATION_DECISION_ADDED_VERSION)) {
207-
out.writeOptionalWriteable(allocationDecision);
208-
}
200+
out.writeOptionalWriteable(allocationDecision);
209201
}
210202

211203
@Override

0 commit comments

Comments
 (0)