Skip to content

Commit 06ca13c

Browse files
Merge branch 'main' into charlotte-connector-RN-update
2 parents e89c1cd + bc0f0ae commit 06ca13c

File tree

116 files changed

+5716
-1151
lines changed

Some content is hidden

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

116 files changed

+5716
-1151
lines changed

docs/changelog/126843.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ breaking:
4242
`com.amazonaws.sdk.ec2MetadataServiceEndpointOverride` system property.
4343
4444
* AWS SDK v2 does not permit specifying a choice between HTTP and HTTPS so
45-
the `s3.client.${CLIENT_NAME}.protocol` setting is deprecated and no longer
46-
has any effect.
45+
the `s3.client.${CLIENT_NAME}.protocol` setting is deprecated.
4746
4847
* AWS SDK v2 does not permit control over throttling for retries, so the
4948
the `s3.client.${CLIENT_NAME}.use_throttle_retries` setting is deprecated
@@ -81,9 +80,9 @@ breaking:
8180
* If applicable, discontinue use of the
8281
`com.amazonaws.sdk.ec2MetadataServiceEndpointOverride` system property.
8382
84-
* If applicable, specify that you wish to use the insecure HTTP protocol to
85-
access the S3 API by setting `s3.client.${CLIENT_NAME}.endpoint` to a URL
86-
which starts with `http://`.
83+
* If applicable, specify the protocol to use to access the S3 API by
84+
setting `s3.client.${CLIENT_NAME}.endpoint` to a URL which starts with
85+
`http://` or `https://`.
8786
8887
* If applicable, discontinue use of the `log-delivery-write` canned ACL.
8988

docs/changelog/127582.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 127582
2+
summary: Specialize ags `AddInput` for each block type
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

docs/reference/elasticsearch/configuration-reference/security-settings.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,15 @@ $$$jwt-claim-pattern-principal$$$
14861486
`client_authentication.rotation_grace_period`
14871487
: ([Static](docs-content://deploy-manage/deploy/self-managed/configure-elasticsearch.md#static-cluster-setting)) Sets the grace period for how long after rotating the `client_authentication.shared_secret` is valid. `client_authentication.shared_secret` can be rotated by updating the keystore then calling the [reload API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-reload-secure-settings). Defaults to `1m`.
14881488

1489+
`http.proxy.host`
1490+
: ([Static](docs-content://deploy-manage/deploy/self-managed/configure-elasticsearch.md#static-cluster-setting)) Specifies the address of the proxy server for the HTTP client that is used for fetching the JSON Web Key Set from a remote URL.
1491+
1492+
`http.proxy.scheme`
1493+
: ([Static](docs-content://deploy-manage/deploy/self-managed/configure-elasticsearch.md#static-cluster-setting)) Specifies the protocol to use to connect to the proxy server for the HTTP client that is used for fetching the JSON Web Key Set from a remote URL. Must be `http`.
1494+
1495+
`http.proxy.port`
1496+
: ([Static](docs-content://deploy-manage/deploy/self-managed/configure-elasticsearch.md#static-cluster-setting)) Specifies the port of the proxy server for the HTTP client that is used for fetching the JSON Web Key Set from a remote URL. Defaults to `80`.
1497+
14891498
`http.connect_timeout` ![logo cloud](https://doc-icons.s3.us-east-2.amazonaws.com/logo_cloud.svg "Supported on Elastic Cloud Hosted")
14901499
: ([Static](docs-content://deploy-manage/deploy/self-managed/configure-elasticsearch.md#static-cluster-setting)) Sets the timeout for the HTTP client that is used for fetching the JSON Web Key Set from a remote URL. A value of zero means the timeout is not used. Defaults to `5s`.
14911500

docs/reference/query-languages/esql/_snippets/commands/layout/lookup-join.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ If multiple documents in the lookup index match a single row in your
4242
results, the output will contain one row for each matching combination.
4343

4444
::::{tip}
45-
In case of name collisions, the newly created columns will override existing columns.
45+
For important information about using `LOOKUP JOIN`, refer to [Usage notes](../../../../esql/esql-lookup-join.md#usage-notes).
4646
::::
4747

4848
**Examples**

docs/reference/query-languages/esql/_snippets/commands/layout/mv_expand.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ MV_EXPAND column
2222
`column`
2323
: The multivalued column to expand.
2424

25+
::::{warning}
26+
The output rows produced by `MV_EXPAND` can be in any order and may not respect
27+
preceding `SORT`s. To guarantee a certain ordering, place a `SORT` after any
28+
`MV_EXPAND`s.
29+
::::
30+
2531
**Example**
2632

2733
:::{include} ../examples/mv_expand.csv-spec/simple.md

docs/reference/query-languages/esql/esql-lookup-join.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,27 @@ To obtain a join key with a compatible type, use a [conversion function](/refere
156156

157157
For a complete list of supported data types and their internal representations, see the [Supported Field Types documentation](/reference/query-languages/esql/limitations.md#_supported_types).
158158

159+
## Usage notes
160+
161+
This section covers important details about `LOOKUP JOIN` that impact query behavior and results. Review these details to ensure your queries work as expected and to troubleshoot unexpected results.
162+
163+
### Handling name collisions
164+
165+
When fields from the lookup index match existing column names, the new columns override the existing ones.
166+
Before the `LOOKUP JOIN` command, preserve columns by either:
167+
168+
* Using `RENAME` to assign non-conflicting names
169+
* Using `EVAL` to create new columns with different names
170+
171+
### Sorting behavior
172+
173+
The output rows produced by `LOOKUP JOIN` can be in any order and may not
174+
respect preceding `SORT`s. To guarantee a certain ordering, place a `SORT` after
175+
any `LOOKUP JOIN`s.
176+
159177
## Limitations
160178

161-
The following are the current limitations with `LOOKUP JOIN`
179+
The following are the current limitations with `LOOKUP JOIN`:
162180

163181
* Indices in [`lookup` mode](/reference/elasticsearch/index-settings/index-modules.md#index-mode-setting) are always single-sharded.
164182
* Cross cluster search is unsupported initially. Both source and lookup indices must be local.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.repositories.s3;
11+
12+
import fixture.aws.DynamicRegionSupplier;
13+
import fixture.s3.S3HttpFixture;
14+
15+
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
16+
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope;
17+
18+
import org.elasticsearch.test.cluster.ElasticsearchCluster;
19+
import org.elasticsearch.test.fixtures.testcontainers.TestContainersThreadFilter;
20+
import org.junit.ClassRule;
21+
import org.junit.rules.RuleChain;
22+
import org.junit.rules.TestRule;
23+
24+
import java.util.function.Supplier;
25+
26+
import static fixture.aws.AwsCredentialsUtils.fixedAccessKey;
27+
import static org.hamcrest.Matchers.startsWith;
28+
29+
@ThreadLeakFilters(filters = { TestContainersThreadFilter.class })
30+
@ThreadLeakScope(ThreadLeakScope.Scope.NONE) // https://github.com/elastic/elasticsearch/issues/102482
31+
public class RepositoryS3ExplicitProtocolRestIT extends AbstractRepositoryS3RestTestCase {
32+
33+
private static final String PREFIX = getIdentifierPrefix("RepositoryS3ExplicitProtocolRestIT");
34+
private static final String BUCKET = PREFIX + "bucket";
35+
private static final String BASE_PATH = PREFIX + "base_path";
36+
private static final String ACCESS_KEY = PREFIX + "access-key";
37+
private static final String SECRET_KEY = PREFIX + "secret-key";
38+
private static final String CLIENT = "explicit_protocol_client";
39+
40+
private static final Supplier<String> regionSupplier = new DynamicRegionSupplier();
41+
private static final S3HttpFixture s3Fixture = new S3HttpFixture(
42+
true,
43+
BUCKET,
44+
BASE_PATH,
45+
fixedAccessKey(ACCESS_KEY, regionSupplier, "s3")
46+
);
47+
48+
private static String getEndpoint() {
49+
final var s3FixtureAddress = s3Fixture.getAddress();
50+
assertThat(s3FixtureAddress, startsWith("http://"));
51+
return s3FixtureAddress.substring("http://".length());
52+
}
53+
54+
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
55+
.module("repository-s3")
56+
.systemProperty("aws.region", regionSupplier)
57+
.keystore("s3.client." + CLIENT + ".access_key", ACCESS_KEY)
58+
.keystore("s3.client." + CLIENT + ".secret_key", SECRET_KEY)
59+
.setting("s3.client." + CLIENT + ".endpoint", RepositoryS3ExplicitProtocolRestIT::getEndpoint)
60+
.setting("s3.client." + CLIENT + ".protocol", () -> "http")
61+
.build();
62+
63+
@ClassRule
64+
public static TestRule ruleChain = RuleChain.outerRule(s3Fixture).around(cluster);
65+
66+
@Override
67+
protected String getTestRestCluster() {
68+
return cluster.getHttpAddresses();
69+
}
70+
71+
@Override
72+
protected String getBucketName() {
73+
return BUCKET;
74+
}
75+
76+
@Override
77+
protected String getBasePath() {
78+
return BASE_PATH;
79+
}
80+
81+
@Override
82+
protected String getClientName() {
83+
return CLIENT;
84+
}
85+
}

modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3ClientSettings.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ final class S3ClientSettings {
7777
key -> new Setting<>(key, "", s -> s.toLowerCase(Locale.ROOT), Property.NodeScope)
7878
);
7979

80-
/** Formerly the protocol to use to connect to s3, now unused. V2 AWS SDK can infer the protocol from {@link #endpoint}. */
80+
/** The protocol to use to connect to s3, now only used if {@link #endpoint} is not a proper URI that starts with {@code http://} or
81+
* {@code https://}. */
8182
@UpdateForV10(owner = UpdateForV10.Owner.DISTRIBUTED_COORDINATION) // no longer used, should be removed in v10
82-
static final Setting.AffixSetting<HttpScheme> UNUSED_PROTOCOL_SETTING = Setting.affixKeySetting(
83+
static final Setting.AffixSetting<HttpScheme> PROTOCOL_SETTING = Setting.affixKeySetting(
8384
PREFIX,
8485
"protocol",
8586
key -> new Setting<>(key, "https", s -> HttpScheme.valueOf(s.toUpperCase(Locale.ROOT)), Property.NodeScope, Property.Deprecated)
@@ -181,6 +182,9 @@ final class S3ClientSettings {
181182
/** Credentials to authenticate with s3. */
182183
final AwsCredentials credentials;
183184

185+
/** The scheme (HTTP or HTTPS) for talking to the endpoint, for use only if the endpoint doesn't contain an explicit scheme */
186+
final HttpScheme protocol;
187+
184188
/** The s3 endpoint the client should talk to, or empty string to use the default. */
185189
final String endpoint;
186190

@@ -221,6 +225,7 @@ final class S3ClientSettings {
221225

222226
private S3ClientSettings(
223227
AwsCredentials credentials,
228+
HttpScheme protocol,
224229
String endpoint,
225230
String proxyHost,
226231
int proxyPort,
@@ -235,6 +240,7 @@ private S3ClientSettings(
235240
String region
236241
) {
237242
this.credentials = credentials;
243+
this.protocol = protocol;
238244
this.endpoint = endpoint;
239245
this.proxyHost = proxyHost;
240246
this.proxyPort = proxyPort;
@@ -261,6 +267,7 @@ S3ClientSettings refine(Settings repositorySettings) {
261267
.put(repositorySettings)
262268
.normalizePrefix(PREFIX + PLACEHOLDER_CLIENT + '.')
263269
.build();
270+
final HttpScheme newProtocol = getRepoSettingOrDefault(PROTOCOL_SETTING, normalizedSettings, protocol);
264271
final String newEndpoint = getRepoSettingOrDefault(ENDPOINT_SETTING, normalizedSettings, endpoint);
265272

266273
final String newProxyHost = getRepoSettingOrDefault(PROXY_HOST_SETTING, normalizedSettings, proxyHost);
@@ -284,7 +291,8 @@ S3ClientSettings refine(Settings repositorySettings) {
284291
newCredentials = credentials;
285292
}
286293
final String newRegion = getRepoSettingOrDefault(REGION, normalizedSettings, region);
287-
if (Objects.equals(endpoint, newEndpoint)
294+
if (Objects.equals(protocol, newProtocol)
295+
&& Objects.equals(endpoint, newEndpoint)
288296
&& Objects.equals(proxyHost, newProxyHost)
289297
&& proxyPort == newProxyPort
290298
&& proxyScheme == newProxyScheme
@@ -299,6 +307,7 @@ S3ClientSettings refine(Settings repositorySettings) {
299307
}
300308
return new S3ClientSettings(
301309
newCredentials,
310+
newProtocol,
302311
newEndpoint,
303312
newProxyHost,
304313
newProxyPort,
@@ -405,6 +414,7 @@ static S3ClientSettings getClientSettings(final Settings settings, final String
405414
) {
406415
return new S3ClientSettings(
407416
S3ClientSettings.loadCredentials(settings, clientName),
417+
getConfigValue(settings, clientName, PROTOCOL_SETTING),
408418
getConfigValue(settings, clientName, ENDPOINT_SETTING),
409419
getConfigValue(settings, clientName, PROXY_HOST_SETTING),
410420
getConfigValue(settings, clientName, PROXY_PORT_SETTING),
@@ -435,6 +445,7 @@ public boolean equals(final Object o) {
435445
&& maxConnections == that.maxConnections
436446
&& maxRetries == that.maxRetries
437447
&& Objects.equals(credentials, that.credentials)
448+
&& Objects.equals(protocol, that.protocol)
438449
&& Objects.equals(endpoint, that.endpoint)
439450
&& Objects.equals(proxyHost, that.proxyHost)
440451
&& proxyScheme == that.proxyScheme
@@ -448,6 +459,7 @@ public boolean equals(final Object o) {
448459
public int hashCode() {
449460
return Objects.hash(
450461
credentials,
462+
protocol,
451463
endpoint,
452464
proxyHost,
453465
proxyPort,

modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3RepositoryPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public List<Setting<?>> getSettings() {
131131
S3ClientSettings.SECRET_KEY_SETTING,
132132
S3ClientSettings.SESSION_TOKEN_SETTING,
133133
S3ClientSettings.ENDPOINT_SETTING,
134-
S3ClientSettings.UNUSED_PROTOCOL_SETTING,
134+
S3ClientSettings.PROTOCOL_SETTING,
135135
S3ClientSettings.PROXY_HOST_SETTING,
136136
S3ClientSettings.PROXY_PORT_SETTING,
137137
S3ClientSettings.PROXY_SCHEME_SETTING,

modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Service.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,18 @@ protected S3ClientBuilder buildClientBuilder(S3ClientSettings clientSettings, Sd
257257
String endpoint = clientSettings.endpoint;
258258
if ((endpoint.startsWith("http://") || endpoint.startsWith("https://")) == false) {
259259
// The SDK does not know how to interpret endpoints without a scheme prefix and will error. Therefore, when the scheme is
260-
// absent, we'll supply HTTPS as a default to avoid errors.
260+
// absent, we'll look at the deprecated .protocol setting
261261
// See https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/client-configuration.html#client-config-other-diffs
262-
endpoint = "https://" + endpoint;
262+
endpoint = switch (clientSettings.protocol) {
263+
case HTTP -> "http://" + endpoint;
264+
case HTTPS -> "https://" + endpoint;
265+
};
263266
LOGGER.warn(
264267
"""
265-
found S3 client with endpoint [{}] that is missing a scheme, guessing it should use 'https://'; \
268+
found S3 client with endpoint [{}] that is missing a scheme, guessing it should be [{}]; \
266269
to suppress this warning, add a scheme prefix to the [{}] setting on this node""",
267270
clientSettings.endpoint,
271+
endpoint,
268272
S3ClientSettings.ENDPOINT_SETTING.getConcreteSettingForNamespace("CLIENT_NAME").getKey()
269273
);
270274
}

0 commit comments

Comments
 (0)