Skip to content

Commit ad5c589

Browse files
committed
Merge branch 'main' into 2025/02/25/write-load-forecast-licence-checks
2 parents 0910fdc + ec82c24 commit ad5c589

File tree

15 files changed

+235
-68
lines changed

15 files changed

+235
-68
lines changed

docs/changelog/122886.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 122886
2+
summary: Add support to VALUES aggregation for spatial types
3+
area: ES|QL
4+
type: bug
5+
issues:
6+
- 122413

docs/reference/esql/functions/kibana/definition/values.json

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/entitlement/src/main/java/org/elasticsearch/entitlement/bootstrap/EntitlementBootstrap.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public record BootstrapArgs(
4141
Path configDir,
4242
Path libDir,
4343
Path logsDir,
44-
Path tempDir
44+
Path tempDir,
45+
Path pidFile
4546
) {
4647
public BootstrapArgs {
4748
requireNonNull(pluginPolicies);
@@ -80,6 +81,7 @@ public static BootstrapArgs bootstrapArgs() {
8081
* @param libDir the lib directory for Elasticsearch
8182
* @param tempDir the temp directory for Elasticsearch
8283
* @param logsDir the log directory for Elasticsearch
84+
* @param pidFile path to a pid file for Elasticsearch, or {@code null} if one was not specified
8385
*/
8486
public static void bootstrap(
8587
Map<String, Policy> pluginPolicies,
@@ -91,7 +93,8 @@ public static void bootstrap(
9193
Path configDir,
9294
Path libDir,
9395
Path logsDir,
94-
Path tempDir
96+
Path tempDir,
97+
Path pidFile
9598
) {
9699
logger.debug("Loading entitlement agent");
97100
if (EntitlementBootstrap.bootstrapArgs != null) {
@@ -107,7 +110,8 @@ public static void bootstrap(
107110
configDir,
108111
libDir,
109112
logsDir,
110-
tempDir
113+
tempDir,
114+
pidFile
111115
);
112116
exportInitializationToAgent();
113117
loadAgent(findAgentJar());

libs/entitlement/src/main/java/org/elasticsearch/entitlement/initialization/EntitlementInitialization.java

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,36 @@ private static PolicyManager createPolicyManager() {
148148
);
149149

150150
List<Scope> serverScopes = new ArrayList<>();
151+
List<FileData> serverModuleFileDatas = new ArrayList<>();
152+
Collections.addAll(
153+
serverModuleFileDatas,
154+
// Base ES directories
155+
FileData.ofPath(bootstrapArgs.configDir(), READ),
156+
FileData.ofPath(bootstrapArgs.logsDir(), READ_WRITE),
157+
FileData.ofRelativePath(Path.of(""), DATA, READ_WRITE),
158+
FileData.ofRelativePath(Path.of(""), SHARED_REPO, READ_WRITE),
159+
160+
// OS release on Linux
161+
FileData.ofPath(Path.of("/etc/os-release"), READ).withPlatform(LINUX),
162+
FileData.ofPath(Path.of("/etc/system-release"), READ).withPlatform(LINUX),
163+
FileData.ofPath(Path.of("/usr/lib/os-release"), READ).withPlatform(LINUX),
164+
// read max virtual memory areas
165+
FileData.ofPath(Path.of("/proc/sys/vm/max_map_count"), READ).withPlatform(LINUX),
166+
FileData.ofPath(Path.of("/proc/meminfo"), READ).withPlatform(LINUX),
167+
// load averages on Linux
168+
FileData.ofPath(Path.of("/proc/loadavg"), READ).withPlatform(LINUX),
169+
// control group stats on Linux. cgroup v2 stats are in an unpredicable
170+
// location under `/sys/fs/cgroup`, so unfortunately we have to allow
171+
// read access to the entire directory hierarchy.
172+
FileData.ofPath(Path.of("/proc/self/cgroup"), READ).withPlatform(LINUX),
173+
FileData.ofPath(Path.of("/sys/fs/cgroup/"), READ).withPlatform(LINUX),
174+
// // io stats on Linux
175+
FileData.ofPath(Path.of("/proc/self/mountinfo"), READ).withPlatform(LINUX),
176+
FileData.ofPath(Path.of("/proc/diskstats"), READ).withPlatform(LINUX)
177+
);
178+
if (bootstrapArgs.pidFile() != null) {
179+
serverModuleFileDatas.add(FileData.ofPath(bootstrapArgs.pidFile(), READ_WRITE));
180+
}
151181
Collections.addAll(
152182
serverScopes,
153183
new Scope(
@@ -173,33 +203,7 @@ private static PolicyManager createPolicyManager() {
173203
new OutboundNetworkEntitlement(),
174204
new LoadNativeLibrariesEntitlement(),
175205
new ManageThreadsEntitlement(),
176-
new FilesEntitlement(
177-
List.of(
178-
// Base ES directories
179-
FileData.ofPath(bootstrapArgs.configDir(), READ),
180-
FileData.ofPath(bootstrapArgs.logsDir(), READ_WRITE),
181-
FileData.ofRelativePath(Path.of(""), DATA, READ_WRITE),
182-
FileData.ofRelativePath(Path.of(""), SHARED_REPO, READ_WRITE),
183-
184-
// OS release on Linux
185-
FileData.ofPath(Path.of("/etc/os-release"), READ).withPlatform(LINUX),
186-
FileData.ofPath(Path.of("/etc/system-release"), READ).withPlatform(LINUX),
187-
FileData.ofPath(Path.of("/usr/lib/os-release"), READ).withPlatform(LINUX),
188-
// read max virtual memory areas
189-
FileData.ofPath(Path.of("/proc/sys/vm/max_map_count"), READ).withPlatform(LINUX),
190-
FileData.ofPath(Path.of("/proc/meminfo"), READ).withPlatform(LINUX),
191-
// load averages on Linux
192-
FileData.ofPath(Path.of("/proc/loadavg"), READ).withPlatform(LINUX),
193-
// control group stats on Linux. cgroup v2 stats are in an unpredicable
194-
// location under `/sys/fs/cgroup`, so unfortunately we have to allow
195-
// read access to the entire directory hierarchy.
196-
FileData.ofPath(Path.of("/proc/self/cgroup"), READ).withPlatform(LINUX),
197-
FileData.ofPath(Path.of("/sys/fs/cgroup/"), READ).withPlatform(LINUX),
198-
// // io stats on Linux
199-
FileData.ofPath(Path.of("/proc/self/mountinfo"), READ).withPlatform(LINUX),
200-
FileData.ofPath(Path.of("/proc/diskstats"), READ).withPlatform(LINUX)
201-
)
202-
)
206+
new FilesEntitlement(serverModuleFileDatas)
203207
)
204208
),
205209
new Scope("org.apache.httpcomponents.httpclient", List.of(new OutboundNetworkEntitlement())),
@@ -251,7 +255,9 @@ private static PolicyManager createPolicyManager() {
251255
new FilesEntitlement(
252256
List.of(
253257
FileData.ofPath(Path.of("/co/elastic/apm/agent/"), READ),
254-
FileData.ofPath(Path.of("/agent/co/elastic/apm/agent/"), READ)
258+
FileData.ofPath(Path.of("/agent/co/elastic/apm/agent/"), READ),
259+
FileData.ofPath(Path.of("/proc/meminfo"), READ),
260+
FileData.ofPath(Path.of("/sys/fs/cgroup/"), READ)
255261
)
256262
)
257263
);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ private static void initPhase2(Bootstrap bootstrap) throws IOException {
255255
nodeEnv.configDir(),
256256
nodeEnv.libDir(),
257257
nodeEnv.logsDir(),
258-
nodeEnv.tmpDir()
258+
nodeEnv.tmpDir(),
259+
args.pidFile()
259260
);
260261
entitlementSelfTest();
261262
} else {

x-pack/plugin/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ tasks.named("yamlRestCompatTestTransform").configure({ task ->
102102
task.skipTest("esql/190_lookup_join/alias-pattern-multiple", "LOOKUP JOIN does not support index aliases for now")
103103
task.skipTest("esql/190_lookup_join/alias-pattern-single", "LOOKUP JOIN does not support index aliases for now")
104104
task.skipTest("esql/180_match_operator/match with disjunctions", "Disjunctions in full text functions work now")
105+
task.skipTest("esql/130_spatial/values unsupported for geo_point", "Spatial types are now supported in VALUES aggregation")
106+
task.skipTest("esql/130_spatial/values unsupported for geo_point status code", "Spatial types are now supported in VALUES aggregation")
105107
// Expected deprecation warning to compat yaml tests:
106108
task.addAllowedWarningRegex(".*rollup functionality will be removed in Elasticsearch.*")
107109
task.skipTest("esql/40_tsdb/from doc with aggregate_metric_double", "TODO: support for subset of metric fields")

0 commit comments

Comments
 (0)