Skip to content

Commit 0f0f0b0

Browse files
authored
Merge pull request #146 from elastic/master
2 parents 7425701 + aebb7bc commit 0f0f0b0

File tree

21 files changed

+369
-47
lines changed

21 files changed

+369
-47
lines changed

.ci/bwcVersions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,6 @@ BWC_VERSION:
6464
- "8.2.1"
6565
- "8.2.2"
6666
- "8.2.3"
67+
- "8.2.4"
6768
- "8.3.0"
6869
- "8.4.0"

.ci/snapshotBwcVersions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
BWC_VERSION:
22
- "7.17.5"
3-
- "8.2.3"
3+
- "8.2.4"
44
- "8.3.0"
55
- "8.4.0"

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,12 @@ causes and their causes, as well as any suppressed exceptions and so on:
450450
logger.debug("operation failed", exception);
451451

452452
If you wish to use placeholders and an exception at the same time, construct a
453-
`ParameterizedMessage`:
453+
`Supplier<String>` and use `org.elasticsearch.core.Strings.format`
454+
- note java.util.Formatter syntax
454455

455-
logger.debug(() -> "failed at offset [" + offset + "]", exception);
456+
logger.debug(() -> Strings.format("failed at offset [%s]", offset), exception);
456457

457-
You can also use a `Supplier<ParameterizedMessage>` to avoid constructing
458+
You can also use a `java.util.Supplier<String>` to avoid constructing
458459
expensive messages that will usually be discarded:
459460

460461
logger.debug(() -> "rarely seen output [" + expensiveMethod() + "]");

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ public static boolean isMlCompatible(Version version) {
321321
.map(v -> Version.fromString(v, Version.Mode.RELAXED))
322322
.orElse(null);
323323

324-
// glibc version 2.35 introduced incompatibilities in ML syscall filters that were fixed in 7.17.5+ and 8.2.2+
325-
if (glibcVersion != null && glibcVersion.onOrAfter(Version.fromString("2.35", Version.Mode.RELAXED))) {
324+
// glibc version 2.34 introduced incompatibilities in ML syscall filters that were fixed in 7.17.5+ and 8.2.2+
325+
if (glibcVersion != null && glibcVersion.onOrAfter(Version.fromString("2.34", Version.Mode.RELAXED))) {
326326
if (version.before(Version.fromString("7.17.5"))) {
327327
return false;
328328
} else if (version.getMajor() > 7 && version.before(Version.fromString("8.2.2"))) {

build-tools-internal/src/main/resources/forbidden/es-all-signatures.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,11 @@ java.util.concurrent.ScheduledThreadPoolExecutor#<init>(int)
5454
java.util.concurrent.ScheduledThreadPoolExecutor#<init>(int, java.util.concurrent.ThreadFactory)
5555
java.util.concurrent.ScheduledThreadPoolExecutor#<init>(int, java.util.concurrent.RejectedExecutionHandler)
5656
java.util.concurrent.ScheduledThreadPoolExecutor#<init>(int, java.util.concurrent.ThreadFactory, java.util.concurrent.RejectedExecutionHandler)
57+
58+
59+
@defaultMessage use java.util.Supplier<String> with String.format instead of ParameterizedMessage
60+
org.apache.logging.log4j.message.ParameterizedMessage#<init>(java.lang.String, java.lang.String[], java.lang.Throwable)
61+
org.apache.logging.log4j.message.ParameterizedMessage#<init>(java.lang.String, java.lang.Object[], java.lang.Throwable)
62+
org.apache.logging.log4j.message.ParameterizedMessage#<init>(java.lang.String, java.lang.Object[])
63+
org.apache.logging.log4j.message.ParameterizedMessage#<init>(java.lang.String, java.lang.Object)
64+
org.apache.logging.log4j.message.ParameterizedMessage#<init>(java.lang.String, java.lang.Object, java.lang.Object)

docs/changelog/87498.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 87498
2+
summary: Avoid attempting PIT close on PIT open failure
3+
area: EQL
4+
type: bug
5+
issues: []

docs/changelog/87554.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 87554
2+
summary: "[TSDB] Add Kahan support to downsampling summation"
3+
area: "Rollup"
4+
type: enhancement
5+
issues: []

docs/reference/ml/anomaly-detection/ml-configuring-transform.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ GET _ml/datafeeds/datafeed-test2/_preview
284284
// TEST[skip:continued]
285285

286286
<1> This runtime field uses the `toLowerCase` function to convert a string to
287-
all lowercase letters. Likewise, you can use the `toUpperCase{}` function to
287+
all lowercase letters. Likewise, you can use the `toUpperCase` function to
288288
convert a string to uppercase letters.
289289

290290
The preview {dfeed} API returns the following results, which show that "JOE"

docs/reference/release-notes.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
This section summarizes the changes in each release.
88

9+
* <<release-notes-8.2.3>>
910
* <<release-notes-8.2.2>>
1011
* <<release-notes-8.2.1>>
1112
* <<release-notes-8.2.0>>
@@ -23,6 +24,7 @@ This section summarizes the changes in each release.
2324

2425
--
2526

27+
include::release-notes/8.2.3.asciidoc[]
2628
include::release-notes/8.2.2.asciidoc[]
2729
include::release-notes/8.2.1.asciidoc[]
2830
include::release-notes/8.2.0.asciidoc[]
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[[release-notes-8.2.3]]
2+
== {es} version 8.2.3
3+
4+
Also see <<breaking-changes-8.2,Breaking changes in 8.2>>.
5+
6+
[[bug-8.2.3]]
7+
[float]
8+
=== Bug fixes
9+
10+
Authorization::
11+
* Fix resolution of wildcard application privileges {es-pull}87293[#87293]
12+
13+
CCR::
14+
* Remove some blocking in CcrRepository {es-pull}87235[#87235]
15+
16+
Indices APIs::
17+
* Add Resolve Index API to the "read" permission for an index {es-pull}87052[#87052] (issue: {es-issue}86977[#86977])
18+
19+
Infra/Core::
20+
* Clean up `DeflateCompressor` after exception {es-pull}87163[#87163] (issue: {es-issue}87160[#87160])
21+
22+
Security::
23+
* Security plugin close releasable realms {es-pull}87429[#87429] (issue: {es-issue}86286[#86286])
24+
25+
Snapshot/Restore::
26+
* Fork after calling `getRepositoryData` from `StoreRecovery` {es-pull}87254[#87254] (issue: {es-issue}87237[#87237])
27+
28+
[[enhancement-8.2.3]]
29+
[float]
30+
=== Enhancements
31+
32+
Infra/Core::
33+
* Force property expansion for security policy {es-pull}87396[#87396]
34+
35+

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public class Version implements Comparable<Version>, ToXContentFragment {
112112
public static final Version V_8_2_1 = new Version(8_02_01_99, org.apache.lucene.util.Version.LUCENE_9_1_0);
113113
public static final Version V_8_2_2 = new Version(8_02_02_99, org.apache.lucene.util.Version.LUCENE_9_1_0);
114114
public static final Version V_8_2_3 = new Version(8_02_03_99, org.apache.lucene.util.Version.LUCENE_9_1_0);
115+
public static final Version V_8_2_4 = new Version(8_02_04_99, org.apache.lucene.util.Version.LUCENE_9_1_0);
115116
public static final Version V_8_3_0 = new Version(8_03_00_99, org.apache.lucene.util.Version.LUCENE_9_2_0);
116117
public static final Version V_8_4_0 = new Version(8_04_00_99, org.apache.lucene.util.Version.LUCENE_9_2_0);
117118
public static final Version CURRENT = V_8_4_0;

server/src/main/java/org/elasticsearch/cluster/block/ClusterBlocks.java

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.elasticsearch.cluster.SimpleDiffable;
1313
import org.elasticsearch.cluster.metadata.IndexMetadata;
1414
import org.elasticsearch.cluster.metadata.MetadataIndexStateService;
15-
import org.elasticsearch.common.collect.ImmutableOpenMap;
1615
import org.elasticsearch.common.io.stream.StreamInput;
1716
import org.elasticsearch.common.io.stream.StreamOutput;
1817
import org.elasticsearch.common.util.set.Sets;
@@ -36,15 +35,15 @@
3635
* Represents current cluster level blocks to block dirty operations done against the cluster.
3736
*/
3837
public class ClusterBlocks implements SimpleDiffable<ClusterBlocks> {
39-
public static final ClusterBlocks EMPTY_CLUSTER_BLOCK = new ClusterBlocks(emptySet(), ImmutableOpenMap.of());
38+
public static final ClusterBlocks EMPTY_CLUSTER_BLOCK = new ClusterBlocks(emptySet(), Map.of());
4039

4140
private final Set<ClusterBlock> global;
4241

43-
private final ImmutableOpenMap<String, Set<ClusterBlock>> indicesBlocks;
42+
private final Map<String, Set<ClusterBlock>> indicesBlocks;
4443

4544
private final EnumMap<ClusterBlockLevel, ImmutableLevelHolder> levelHolders;
4645

47-
ClusterBlocks(Set<ClusterBlock> global, ImmutableOpenMap<String, Set<ClusterBlock>> indicesBlocks) {
46+
ClusterBlocks(Set<ClusterBlock> global, Map<String, Set<ClusterBlock>> indicesBlocks) {
4847
this.global = global;
4948
this.indicesBlocks = indicesBlocks;
5049
levelHolders = generateLevelHolders(global, indicesBlocks);
@@ -72,19 +71,19 @@ private Set<ClusterBlock> blocksForIndex(ClusterBlockLevel level, String index)
7271

7372
private static EnumMap<ClusterBlockLevel, ImmutableLevelHolder> generateLevelHolders(
7473
Set<ClusterBlock> global,
75-
ImmutableOpenMap<String, Set<ClusterBlock>> indicesBlocks
74+
Map<String, Set<ClusterBlock>> indicesBlocks
7675
) {
7776

7877
EnumMap<ClusterBlockLevel, ImmutableLevelHolder> levelHolders = new EnumMap<>(ClusterBlockLevel.class);
7978
for (final ClusterBlockLevel level : ClusterBlockLevel.values()) {
8079
Predicate<ClusterBlock> containsLevel = block -> block.contains(level);
8180
Set<ClusterBlock> newGlobal = unmodifiableSet(global.stream().filter(containsLevel).collect(toSet()));
8281

83-
ImmutableOpenMap.Builder<String, Set<ClusterBlock>> indicesBuilder = ImmutableOpenMap.builder();
82+
Map<String, Set<ClusterBlock>> indicesBuilder = new HashMap<>();
8483
for (Map.Entry<String, Set<ClusterBlock>> entry : indicesBlocks.entrySet()) {
8584
indicesBuilder.put(entry.getKey(), unmodifiableSet(entry.getValue().stream().filter(containsLevel).collect(toSet())));
8685
}
87-
levelHolders.put(level, new ImmutableLevelHolder(newGlobal, indicesBuilder.build()));
86+
levelHolders.put(level, new ImmutableLevelHolder(newGlobal, Map.copyOf(indicesBuilder)));
8887
}
8988
return levelHolders;
9089
}
@@ -275,10 +274,7 @@ private static void writeBlockSet(Set<ClusterBlock> blocks, StreamOutput out) th
275274

276275
public static ClusterBlocks readFrom(StreamInput in) throws IOException {
277276
final Set<ClusterBlock> global = readBlockSet(in);
278-
ImmutableOpenMap<String, Set<ClusterBlock>> indicesBlocks = in.readImmutableOpenMap(
279-
i -> i.readString().intern(),
280-
ClusterBlocks::readBlockSet
281-
);
277+
Map<String, Set<ClusterBlock>> indicesBlocks = in.readImmutableMap(i -> i.readString().intern(), ClusterBlocks::readBlockSet);
282278
if (global.isEmpty() && indicesBlocks.isEmpty()) {
283279
return EMPTY_CLUSTER_BLOCK;
284280
}
@@ -294,7 +290,7 @@ public static Diff<ClusterBlocks> readDiffFrom(StreamInput in) throws IOExceptio
294290
return SimpleDiffable.readDiffFrom(ClusterBlocks::readFrom, in);
295291
}
296292

297-
record ImmutableLevelHolder(Set<ClusterBlock> global, ImmutableOpenMap<String, Set<ClusterBlock>> indices) {}
293+
record ImmutableLevelHolder(Set<ClusterBlock> global, Map<String, Set<ClusterBlock>> indices) {}
298294

299295
public static Builder builder() {
300296
return new Builder();
@@ -418,11 +414,11 @@ public ClusterBlocks build() {
418414
return EMPTY_CLUSTER_BLOCK;
419415
}
420416
// We copy the block sets here in case of the builder is modified after build is called
421-
ImmutableOpenMap.Builder<String, Set<ClusterBlock>> indicesBuilder = ImmutableOpenMap.builder(indices.size());
417+
Map<String, Set<ClusterBlock>> indicesBuilder = new HashMap<>(indices.size());
422418
for (Map.Entry<String, Set<ClusterBlock>> entry : indices.entrySet()) {
423419
indicesBuilder.put(entry.getKey(), Set.copyOf(entry.getValue()));
424420
}
425-
return new ClusterBlocks(Set.copyOf(global), indicesBuilder.build());
421+
return new ClusterBlocks(Set.copyOf(global), Map.copyOf(indicesBuilder));
426422
}
427423
}
428424
}

server/src/main/java/org/elasticsearch/search/aggregations/metrics/CompensatedSum.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public CompensatedSum(double value, double delta) {
3535
this.delta = delta;
3636
}
3737

38+
public CompensatedSum() {
39+
this(0, 0);
40+
}
41+
3842
/**
3943
* The value of the sum.
4044
*/

server/src/test/java/org/elasticsearch/cluster/block/ClusterBlockTests.java

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

1111
import org.elasticsearch.Version;
1212
import org.elasticsearch.common.UUIDs;
13-
import org.elasticsearch.common.collect.ImmutableOpenMap;
1413
import org.elasticsearch.common.io.stream.BytesStreamOutput;
1514
import org.elasticsearch.common.io.stream.StreamInput;
1615
import org.elasticsearch.rest.RestStatus;
@@ -19,6 +18,7 @@
1918
import java.util.Arrays;
2019
import java.util.Collections;
2120
import java.util.List;
21+
import java.util.Map;
2222

2323
import static java.util.EnumSet.copyOf;
2424
import static org.elasticsearch.test.VersionUtils.randomVersion;
@@ -56,7 +56,7 @@ public void testToStringDanglingComma() {
5656

5757
public void testGlobalBlocksCheckedIfNoIndicesSpecified() {
5858
ClusterBlock globalBlock = randomClusterBlock();
59-
ClusterBlocks clusterBlocks = new ClusterBlocks(Collections.singleton(globalBlock), ImmutableOpenMap.of());
59+
ClusterBlocks clusterBlocks = new ClusterBlocks(Collections.singleton(globalBlock), Map.of());
6060
ClusterBlockException exception = clusterBlocks.indicesBlockedException(randomFrom(globalBlock.levels()), new String[0]);
6161
assertNotNull(exception);
6262
assertEquals(exception.blocks(), Collections.singleton(globalBlock));

server/src/test/java/org/elasticsearch/common/logging/LoggersTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
public class LoggersTests extends ESTestCase {
2525

26-
public void testParameterizedMessageLambda() throws Exception {
26+
public void testStringSupplierAndFormatting() throws Exception {
2727
// adding a random id to allow test to run multiple times. See AbstractConfiguration#addAppender
2828
final MockAppender appender = new MockAppender("trace_appender" + randomInt());
2929
appender.start();

x-pack/docs/en/security/authorization/mapping-roles.asciidoc

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,35 @@
22
[[mapping-roles]]
33
=== Mapping users and groups to roles
44

5-
If you authenticate users with the `native` or `file` realms, you can manage
6-
role assignment by using the <<managing-native-users,user management APIs>> or
7-
the <<users-command,users>> command-line tool respectively.
5+
Role mapping is supported by all realms except `native` and `file`.
86

9-
For other types of realms, you must create _role-mappings_ that define which
10-
roles should be assigned to each user based on their username, groups, or
11-
other metadata.
7+
The native and file realms assign roles directly to users.
8+
Native realms use <<managing-native-users,user management APIs>>.
9+
File realms use <<roles-management-file,File-based role management>>.
10+
11+
You can map roles through the
12+
<<mapping-roles-api, Role mapping API>> (recommended) or a <<mapping-roles-file, Role mapping file>>.
13+
14+
15+
The PKI, LDAP, AD, Kerberos, OpenID Connect, JWT, and SAML realms support the
16+
<<mapping-roles-api, Role mapping API>>. Only PKI, LDAP, and AD realms
17+
support <<mapping-roles-file, Role mapping files>>.
18+
19+
The PKI, LDAP, AD, Kerberos, OpenID Connect, JWT, and
20+
SAML realms also support <<authorization_realms,delegated authorization>>.
21+
You can either map roles for a realm or use delegated authorization; you cannot use both simultaneously.
22+
23+
To use role mapping, you create roles and role mapping rules.
24+
Role mapping rules can be based on realm name, realm type, username, groups,
25+
other user metadata, or combinations of those values.
1226

1327
NOTE: When <<anonymous-access,anonymous access>> is enabled, the roles
1428
of the anonymous user are assigned to all the other users as well.
1529

30+
If there are role-mapping rules created through the API as well as a role mapping file,
31+
the rules are combined.
32+
It's possible for a single user to have some roles that were mapped through the API,
33+
and others assigned based on the role mapping file.
1634
You can define role-mappings via an
1735
<<mapping-roles-api, API>> or manage them through <<mapping-roles-file, files>>.
1836
These two sources of role-mapping are combined inside of the {es}
@@ -21,18 +39,19 @@ possible for a single user to have some roles that have been mapped through
2139
the API, and other roles that are mapped through files.
2240

2341
NOTE: Users with no roles assigned will be unauthorized for any action.
42+
In other words, they may be able to authenticate, but they will have no roles.
43+
No roles means no privileges, and no privileges means no authorizations to
44+
make requests.
2445

25-
When you use role-mappings, you assign existing roles to users.
46+
When you use role mappings to assign roles to users, the roles must exist.
47+
There are two sources of roles.
2648
The available roles should either be added using the
2749
<<security-role-apis,role management APIs>> or defined in the
2850
<<roles-management-file,roles file>>. Either role-mapping method can use
2951
either role management method. For example, when you use the role mapping API,
3052
you are able to map users to both API-managed roles and file-managed roles
3153
(and likewise for file-based role-mappings).
3254

33-
TIP: The PKI, LDAP, Kerberos, OpenID Connect, JWT, and SAML realms support using
34-
<<authorization_realms,authorization realms>> as an alternative to role mapping.
35-
3655
[[mapping-roles-api]]
3756
==== Using the role mapping API
3857

x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/execution/search/PITAwareQueryClient.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,14 @@ private <Response> void openPIT(ActionListener<Response> listener, Runnable runn
139139

140140
@Override
141141
public void close(ActionListener<Boolean> listener) {
142-
client.execute(
143-
ClosePointInTimeAction.INSTANCE,
144-
new ClosePointInTimeRequest(pitId),
145-
map(listener, ClosePointInTimeResponse::isSucceeded)
146-
);
147-
pitId = null;
142+
// the pitId could be null as a consequence of a failure on openPIT
143+
if (pitId != null) {
144+
client.execute(
145+
ClosePointInTimeAction.INSTANCE,
146+
new ClosePointInTimeRequest(pitId),
147+
map(listener, ClosePointInTimeResponse::isSucceeded)
148+
);
149+
pitId = null;
150+
}
148151
}
149152
}

x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/execution/sequence/CircuitBreakerTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ <Response extends ActionResponse> void handleSearchRequest(ActionListener<Respon
388388
0,
389389
ShardSearchFailure.EMPTY_ARRAY,
390390
SearchResponse.Clusters.EMPTY,
391-
searchRequestsRemainingCount() == 1 ? searchRequest.pointInTimeBuilder().getEncodedId() : null
391+
searchRequest.pointInTimeBuilder().getEncodedId()
392392
);
393393

394394
if (searchRequestsRemainingCount() == 1) {
@@ -467,7 +467,7 @@ <Response extends ActionResponse> void handleSearchRequest(ActionListener<Respon
467467
0,
468468
failures,
469469
SearchResponse.Clusters.EMPTY,
470-
null
470+
searchRequest.pointInTimeBuilder().getEncodedId()
471471
);
472472

473473
// this should still be caught and the exception handled properly and circuit breaker cleared

0 commit comments

Comments
 (0)