Skip to content

Commit 4c84a11

Browse files
Merge branch 'main' into charlotte-connector-RN-update
2 parents 4fecf68 + 4790910 commit 4c84a11

File tree

21 files changed

+126
-286
lines changed

21 files changed

+126
-286
lines changed
Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
# Elasticsearch and index management
22

3-
% TO-DO: Add links to "Elasticsearch basics"%
3+
This section contains reference information for {{es}} and index management features.
44

5-
This section contains reference information for Elasticsearch and index management features, including:
5+
To learn more about {{es}} features and how to get started, refer to the [{{es}}](docs-content://solutions/search.md) documentation.
66

7-
* Settings
8-
* Security roles and privileges
9-
* Index lifecycle actions
10-
* Mappings
11-
* Command line tools
12-
* Curator
13-
* Clients
7+
For more details about query and scripting languages, check these sections:
8+
* [Query languages](../query-languages/index.md)
9+
* [Scripting languages](../scripting-languages/index.md)
10+
11+
{{es}} also provides the following REST APIs:
1412

15-
% TO-DO: Add links to "query language and scripting language sections"%
16-
17-
Elasticsearch also provides REST APIs that are used by the UI components and can be called directly to configure and access Elasticsearch features.
18-
Refer to [Elasticsearch API](https://www.elastic.co/docs/api/doc/elasticsearch) and [Elasticsearch Serverless API](https://www.elastic.co/docs/api/doc/elasticsearch-serverless).
13+
* [{{es}} API](https://www.elastic.co/docs/api/doc/elasticsearch)
14+
* [{{es}} Serverless API](https://www.elastic.co/docs/api/doc/elasticsearch-serverless)

docs/release-notes/known-issues.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,10 @@ This issue will be fixed in a future patch release (see [PR #126990](https://git
2727
```
2828
2929
For information about editing your JVM settings, refer to [JVM settings](https://www.elastic.co/docs/reference/elasticsearch/jvm-settings).
30+
31+
* Users upgrading from an Elasticsearch cluster that had previously been on a version between 7.10.0 and 7.12.1 may see that Watcher will not start on 9.x. The solution is to run the following commands in Kibana Dev Tools (or the equivalent using curl):
32+
```
33+
DELETE _index_template/.triggered_watches
34+
DELETE _index_template/.watches
35+
POST /_watcher/_start
36+
```

libs/core/src/main/java/org/elasticsearch/core/internal/provider/EmbeddedImplClassLoader.java

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@
2323
import java.nio.file.FileSystems;
2424
import java.nio.file.Files;
2525
import java.nio.file.Path;
26-
import java.security.AccessController;
2726
import java.security.CodeSigner;
2827
import java.security.CodeSource;
29-
import java.security.PrivilegedAction;
3028
import java.security.SecureClassLoader;
3129
import java.util.ArrayList;
3230
import java.util.Collections;
@@ -96,8 +94,7 @@ record JarMeta(String prefix, boolean isMultiRelease, Set<String> packages, Map<
9694
private final ClassLoader parent;
9795

9896
static EmbeddedImplClassLoader getInstance(ClassLoader parent, String providerName) {
99-
PrivilegedAction<EmbeddedImplClassLoader> pa = () -> new EmbeddedImplClassLoader(parent, getProviderPrefixes(parent, providerName));
100-
return AccessController.doPrivileged(pa);
97+
return new EmbeddedImplClassLoader(parent, getProviderPrefixes(parent, providerName));
10198
}
10299

103100
private EmbeddedImplClassLoader(ClassLoader parent, Map<JarMeta, CodeSource> prefixToCodeBase) {
@@ -120,14 +117,12 @@ private EmbeddedImplClassLoader(ClassLoader parent, Map<JarMeta, CodeSource> pre
120117
record Resource(InputStream inputStream, CodeSource codeSource) {}
121118

122119
/** Searches for the named resource. Iterates over all prefixes. */
123-
private Resource privilegedGetResourceOrNull(JarMeta jarMeta, String pkg, String filepath) {
124-
return AccessController.doPrivileged((PrivilegedAction<Resource>) () -> {
125-
InputStream is = findResourceInLoaderPkgOrNull(jarMeta, pkg, filepath, parent::getResourceAsStream);
126-
if (is != null) {
127-
return new Resource(is, prefixToCodeBase.get(jarMeta.prefix()));
128-
}
129-
return null;
130-
});
120+
private Resource getResourceOrNull(JarMeta jarMeta, String pkg, String filepath) {
121+
InputStream is = findResourceInLoaderPkgOrNull(jarMeta, pkg, filepath, parent::getResourceAsStream);
122+
if (is != null) {
123+
return new Resource(is, prefixToCodeBase.get(jarMeta.prefix()));
124+
}
125+
return null;
131126
}
132127

133128
@Override
@@ -148,7 +143,7 @@ public Class<?> findClass(String name) throws ClassNotFoundException {
148143
String pkg = toPackageName(filepath);
149144
JarMeta jarMeta = packageToJarMeta.get(pkg);
150145
if (jarMeta != null) {
151-
Resource res = privilegedGetResourceOrNull(jarMeta, pkg, filepath);
146+
Resource res = getResourceOrNull(jarMeta, pkg, filepath);
152147
if (res != null) {
153148
try (InputStream in = res.inputStream()) {
154149
byte[] bytes = in.readAllBytes();

libs/core/src/main/java/org/elasticsearch/core/internal/provider/ProviderLocator.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
import java.io.UncheckedIOException;
1616
import java.lang.module.Configuration;
1717
import java.lang.module.ModuleFinder;
18-
import java.security.AccessController;
19-
import java.security.PrivilegedActionException;
20-
import java.security.PrivilegedExceptionAction;
2118
import java.util.Locale;
2219
import java.util.Objects;
2320
import java.util.ServiceConfigurationError;
@@ -97,10 +94,9 @@ public ProviderLocator(String providerName, Class<T> providerType, String provid
9794
@Override
9895
public T get() {
9996
try {
100-
PrivilegedExceptionAction<T> pa = this::load;
101-
return AccessController.doPrivileged(pa);
102-
} catch (PrivilegedActionException e) {
103-
throw new UncheckedIOException((IOException) e.getCause());
97+
return load();
98+
} catch (IOException e) {
99+
throw new UncheckedIOException(e);
104100
}
105101
}
106102

muted-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,9 @@ tests:
444444
- class: org.elasticsearch.compute.aggregation.blockhash.BlockHashTests
445445
method: test3BytesRefs {forcePackedHash=false}
446446
issue: https://github.com/elastic/elasticsearch/issues/127826
447+
- class: org.elasticsearch.compute.aggregation.FilteredGroupingAggregatorFunctionTests
448+
method: testSimpleCircuitBreaking
449+
issue: https://github.com/elastic/elasticsearch/issues/127833
447450

448451
# Examples:
449452
#

qa/evil-tests/src/test/java/org/elasticsearch/common/logging/EvilLoggerTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public void testConcurrentDeprecationLogger() throws IOException, BrokenBarrierE
174174
assertLogLine(
175175
deprecationEvents.get(i),
176176
DeprecationLogger.CRITICAL,
177-
"org.elasticsearch.common.logging.DeprecationLogger.lambda\\$doPrivilegedLog\\$0",
177+
"org.elasticsearch.common.logging.DeprecationLogger.logDeprecation",
178178
".*This is a maybe logged deprecation message" + i + ".*"
179179
);
180180
}
@@ -207,7 +207,7 @@ public void testDeprecatedSettings() throws IOException {
207207
assertLogLine(
208208
deprecationEvents.get(0),
209209
DeprecationLogger.CRITICAL,
210-
"org.elasticsearch.common.logging.DeprecationLogger.lambda\\$doPrivilegedLog\\$0",
210+
"org.elasticsearch.common.logging.DeprecationLogger.logDeprecation",
211211
".*\\[deprecated.foo\\] setting was deprecated in Elasticsearch and will be removed in a future release..*"
212212
);
213213
}

server/src/main/java/org/elasticsearch/bootstrap/ElasticsearchUncaughtExceptionHandler.java

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
import org.elasticsearch.core.SuppressForbidden;
1515

1616
import java.io.IOError;
17-
import java.security.AccessController;
18-
import java.security.PrivilegedAction;
1917

2018
class ElasticsearchUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
2119
private static final Logger logger = LogManager.getLogger(ElasticsearchUncaughtExceptionHandler.class);
@@ -53,41 +51,17 @@ static boolean isFatalUncaught(Throwable e) {
5351

5452
void onFatalUncaught(final String threadName, final Throwable t) {
5553
final String message = "fatal error in thread [" + threadName + "], exiting";
56-
logErrorMessage(t, message);
54+
logger.error(message, t);
5755
}
5856

5957
void onNonFatalUncaught(final String threadName, final Throwable t) {
6058
final String message = "uncaught exception in thread [" + threadName + "]";
61-
logErrorMessage(t, message);
62-
}
63-
64-
private static void logErrorMessage(Throwable t, String message) {
65-
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
66-
logger.error(message, t);
67-
return null;
68-
});
59+
logger.error(message, t);
6960
}
7061

62+
@SuppressForbidden(reason = "intentionally halting")
7163
void halt(int status) {
72-
AccessController.doPrivileged(new PrivilegedHaltAction(status));
64+
// we halt to prevent shutdown hooks from running
65+
Runtime.getRuntime().halt(status);
7366
}
74-
75-
static class PrivilegedHaltAction implements PrivilegedAction<Void> {
76-
77-
private final int status;
78-
79-
private PrivilegedHaltAction(final int status) {
80-
this.status = status;
81-
}
82-
83-
@SuppressForbidden(reason = "halt")
84-
@Override
85-
public Void run() {
86-
// we halt to prevent shutdown hooks from running
87-
Runtime.getRuntime().halt(status);
88-
return null;
89-
}
90-
91-
}
92-
9367
}

server/src/main/java/org/elasticsearch/common/blobstore/fs/FsBlobStore.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
import java.io.IOException;
1919
import java.nio.file.Files;
2020
import java.nio.file.Path;
21-
import java.security.AccessController;
22-
import java.security.PrivilegedAction;
2321
import java.util.Iterator;
2422
import java.util.List;
2523

@@ -57,14 +55,11 @@ public int bufferSizeInBytes() {
5755
public BlobContainer blobContainer(BlobPath path) {
5856
Path f = buildPath(path);
5957
if (readOnly == false) {
60-
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
61-
try {
62-
Files.createDirectories(f);
63-
} catch (IOException ex) {
64-
throw new ElasticsearchException("failed to create blob container", ex);
65-
}
66-
return null;
67-
});
58+
try {
59+
Files.createDirectories(f);
60+
} catch (IOException ex) {
61+
throw new ElasticsearchException("failed to create blob container", ex);
62+
}
6863
}
6964
return new FsBlobContainer(this, path, f);
7065
}

server/src/main/java/org/elasticsearch/common/logging/DeprecationLogger.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
import org.elasticsearch.common.regex.Regex;
1616
import org.elasticsearch.common.settings.Settings;
1717

18-
import java.security.AccessController;
19-
import java.security.PrivilegedAction;
2018
import java.util.Collections;
2119
import java.util.List;
2220

@@ -119,18 +117,11 @@ private DeprecationLogger logDeprecation(Level level, DeprecationCategory catego
119117
String opaqueId = HeaderWarning.getXOpaqueId();
120118
String productOrigin = HeaderWarning.getProductOrigin();
121119
ESLogMessage deprecationMessage = DeprecatedMessage.of(category, key, opaqueId, productOrigin, msg, params);
122-
doPrivilegedLog(level, deprecationMessage);
120+
logger.log(level, deprecationMessage);
123121
}
124122
return this;
125123
}
126124

127-
private void doPrivilegedLog(Level level, ESLogMessage deprecationMessage) {
128-
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
129-
logger.log(level, deprecationMessage);
130-
return null;
131-
});
132-
}
133-
134125
/**
135126
* Used for handling previous version RestApiCompatible logic.
136127
* Logs a message at the {@link DeprecationLogger#CRITICAL} level

server/src/main/java/org/elasticsearch/common/util/concurrent/EsExecutors.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
import org.elasticsearch.core.SuppressForbidden;
1818
import org.elasticsearch.node.Node;
1919

20-
import java.security.AccessController;
21-
import java.security.PrivilegedAction;
2220
import java.util.List;
2321
import java.util.Optional;
2422
import java.util.concurrent.AbstractExecutorService;
@@ -393,11 +391,9 @@ static class EsThreadFactory implements ThreadFactory {
393391

394392
@Override
395393
public Thread newThread(Runnable r) {
396-
return AccessController.doPrivileged((PrivilegedAction<Thread>) () -> {
397-
Thread t = new EsThread(group, r, namePrefix + "[T#" + threadNumber.getAndIncrement() + "]", 0, isSystem);
398-
t.setDaemon(true);
399-
return t;
400-
});
394+
Thread t = new EsThread(group, r, namePrefix + "[T#" + threadNumber.getAndIncrement() + "]", 0, isSystem);
395+
t.setDaemon(true);
396+
return t;
401397
}
402398
}
403399

0 commit comments

Comments
 (0)