Skip to content

Commit

Permalink
merging main
Browse files Browse the repository at this point in the history
  • Loading branch information
masseyke committed Oct 17, 2023
2 parents 4aa218d + 04db286 commit 13a0822
Show file tree
Hide file tree
Showing 212 changed files with 2,842 additions and 1,903 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ private static String[] pluginProperties(String name, String[] additionalProps,
"version",
"1.0",
"elasticsearch.version",
InstallPluginAction.getSemanticVersion(Build.current().version()),
Build.current().version(),
"java.version",
System.getProperty("java.specification.version")

Expand Down Expand Up @@ -1110,8 +1110,8 @@ public void testOfficialPluginSnapshot() throws Exception {
String url = String.format(
Locale.ROOT,
"https://snapshots.elastic.co/%s-abc123/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-%s.zip",
InstallPluginAction.getSemanticVersion(Build.current().version()),
Build.current().version()
Build.current().version(),
Build.current().qualifiedVersion()
);
assertInstallPluginFromUrl("analysis-icu", url, "abc123", true);
}
Expand All @@ -1120,8 +1120,8 @@ public void testInstallReleaseBuildOfPluginOnSnapshotBuild() {
String url = String.format(
Locale.ROOT,
"https://snapshots.elastic.co/%s-abc123/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-%s.zip",
InstallPluginAction.getSemanticVersion(Build.current().version()),
Build.current().version()
Build.current().version(),
Build.current().qualifiedVersion()
);
// attempting to install a release build of a plugin (no staging ID) on a snapshot build should throw a user exception
final UserException e = expectThrows(
Expand All @@ -1137,9 +1137,9 @@ public void testInstallReleaseBuildOfPluginOnSnapshotBuild() {

public void testOfficialPluginStaging() throws Exception {
String url = "https://staging.elastic.co/"
+ InstallPluginAction.getSemanticVersion(Build.current().version())
+ "-abc123/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-"
+ Build.current().version()
+ "-abc123/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-"
+ Build.current().qualifiedVersion()
+ ".zip";
assertInstallPluginFromUrl("analysis-icu", url, "abc123", false);
}
Expand All @@ -1148,7 +1148,7 @@ public void testOfficialPlatformPlugin() throws Exception {
String url = "https://artifacts.elastic.co/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-"
+ Platforms.PLATFORM_NAME
+ "-"
+ Build.current().version()
+ Build.current().qualifiedVersion()
+ ".zip";
assertInstallPluginFromUrl("analysis-icu", url, null, false);
}
Expand All @@ -1157,16 +1157,16 @@ public void testOfficialPlatformPluginSnapshot() throws Exception {
String url = String.format(
Locale.ROOT,
"https://snapshots.elastic.co/%s-abc123/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-%s-%s.zip",
InstallPluginAction.getSemanticVersion(Build.current().version()),
Build.current().version(),
Platforms.PLATFORM_NAME,
Build.current().version()
Build.current().qualifiedVersion()
);
assertInstallPluginFromUrl("analysis-icu", url, "abc123", true);
}

public void testOfficialPlatformPluginStaging() throws Exception {
String url = "https://staging.elastic.co/"
+ InstallPluginAction.getSemanticVersion(Build.current().version())
+ Build.current().version()
+ "-abc123/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-"
+ Platforms.PLATFORM_NAME
+ "-"
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog/100866.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 100866
summary: "ESQL: Preserve intermediate aggregation output in local relation"
area: ES|QL
type: bug
issues:
- 100807
6 changes: 6 additions & 0 deletions docs/changelog/100875.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 100875
summary: Preserve subfields for unsupported types
area: "Query Languages"
type: bug
issues:
- 100869
10 changes: 5 additions & 5 deletions docs/reference/inference/get-inference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ Retrieves {infer} model information.
[[get-inference-api-desc]]
==== {api-description-title}

You can get information in a single API request for:
You can get information in a single API request for:

* a single {infer} model by providing the task type and the model ID,
* all of the {infer} models for a certain task type by providing the task type
* all of the {infer} models for a certain task type by providing the task type
and a wildcard expression,
* all of the {infer} models by using a wildcard expression.

Expand All @@ -50,7 +50,7 @@ The type of {infer} task that the model performs.
[[get-inference-api-example]]
==== {api-examples-title}

The following API call retrives information about the `my-elser-model` {infer}
The following API call retrives information about the `my-elser-model` {infer}
model that can perform `sparse_embedding` tasks.


Expand All @@ -68,12 +68,12 @@ The API returns the following response:
{
"model_id": "my-elser-model",
"task_type": "sparse_embedding",
"service": "elser_mlnode",
"service": "elser",
"service_settings": {
"num_allocations": 1,
"num_threads": 1
},
"task_settings": {}
}
------------------------------------------------------------
// NOTCONSOLE
// NOTCONSOLE
17 changes: 8 additions & 9 deletions docs/reference/inference/put-inference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Creates a model to perform an {infer} task.
[[put-inference-api-desc]]
==== {api-description-title}

The create {infer} API enables you to create and configure an {infer} model to
perform a specific {infer} task.
The create {infer} API enables you to create and configure an {infer} model to
perform a specific {infer} task.


[discrete]
Expand All @@ -50,32 +50,31 @@ The type of the {infer} task that the model will perform. Available task types:
(Required, string)
The type of service supported for the specified task type.
Available services:
* `elser`,
* `elser_mlnode`.
* `elser`

`service_settings`::
(Required, object)
Settings used to install the {infer} model. These settings are specific to the
Settings used to install the {infer} model. These settings are specific to the
`service` you specified.

`task_settings`::
(Optional, object)
Settings to configure the {infer} task. These settings are specific to the
Settings to configure the {infer} task. These settings are specific to the
`<task_type>` you specified.


[discrete]
[[put-inference-api-example]]
==== {api-examples-title}

The following example shows how to create an {infer} model called
The following example shows how to create an {infer} model called
`my-elser-model` to perform a `sparse_embedding` task type.

[source,console]
------------------------------------------------------------
PUT _inference/sparse_embedding/my-elser-model
{
"service": "elser_mlnode",
"service": "elser",
"service_settings": {
"num_allocations": 1,
"num_threads": 1
Expand All @@ -93,7 +92,7 @@ Example response:
{
"model_id": "my-elser-model",
"task_type": "sparse_embedding",
"service": "elser_mlnode",
"service": "elser",
"service_settings": {
"num_allocations": 1,
"num_threads": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.FailedNodeException;
import org.elasticsearch.action.support.TransportAction;
import org.elasticsearch.action.support.nodes.BaseNodeResponse;
import org.elasticsearch.action.support.nodes.BaseNodesRequest;
import org.elasticsearch.action.support.nodes.BaseNodesResponse;
Expand Down Expand Up @@ -44,10 +45,6 @@ public Request() {
super((String[]) null);
}

public Request(StreamInput in) throws IOException {
super(in);
}

@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject();
Expand All @@ -71,16 +68,19 @@ public boolean equals(Object obj) {
}
return true;
}

@Override
public void writeTo(StreamOutput out) {
TransportAction.localOnly();
}
}

public static class NodeRequest extends TransportRequest {
public NodeRequest(StreamInput in) throws IOException {
super(in);
}

public NodeRequest(Request request) {

}
public NodeRequest() {}
}

public static class Response extends BaseNodesResponse<NodeResponse> implements Writeable, ToXContentObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ public GeoIpDownloaderStatsTransportAction(
) {
super(
GeoIpDownloaderStatsAction.NAME,
threadPool,
clusterService,
transportService,
actionFilters,
Request::new,
NodeRequest::new,
threadPool.executor(ThreadPool.Names.MANAGEMENT)
);
Expand All @@ -66,7 +64,7 @@ protected Response newResponse(Request request, List<NodeResponse> nodeResponses

@Override
protected NodeRequest newNodeRequest(Request request) {
return new NodeRequest(request);
return new NodeRequest();
}

@Override
Expand Down
7 changes: 3 additions & 4 deletions modules/kibana/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
apply plugin: 'elasticsearch.legacy-java-rest-test'
apply plugin: 'elasticsearch.internal-java-rest-test'

esplugin {
description 'Plugin exposing APIs for Kibana system indices'
classname 'org.elasticsearch.kibana.KibanaPlugin'
}

testClusters.configureEach {
module ':modules:reindex'
dependencies {
clusterModules project(':modules:reindex')
}

Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.common.settings.SecureString;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.core.Strings;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.rest.ESRestTestCase;
import org.elasticsearch.xcontent.json.JsonXContent;
import org.junit.ClassRule;

import java.io.IOException;
import java.util.Arrays;
Expand All @@ -29,6 +34,24 @@

public class KibanaSystemIndexIT extends ESRestTestCase {

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.module("reindex")
.module("kibana")
.user("test_kibana_user", "x-pack-test-password", "kibana_system", false)
.build();

@Override
protected String getTestRestCluster() {
return cluster.getHttpAddresses();
}

@Override
protected Settings restClientSettings() {
String token = basicAuthHeaderValue("test_kibana_user", new SecureString("x-pack-test-password".toCharArray()));
return Settings.builder().put(ThreadContext.PREFIX + ".Authorization", token).build();
}

private final String indexName;

public KibanaSystemIndexIT(@Name("indexName") String indexName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ public void emitMetrics() {
for (int i = 0; i < exceptionsHistogram.length(); i++) {
long exceptions = exceptionsHistogram.get(i);
if (exceptions != 0) {
metrics.put("elasticsearch.metrics.s3.exceptions.h" + i, exceptions);
metrics.put("elasticsearch.metrics.s3.exceptions_histogram_" + i, exceptions);
}
}
for (int i = 0; i < throttlesHistogram.length(); i++) {
long throttles = throttlesHistogram.get(i);
if (throttles != 0) {
metrics.put("elasticsearch.metrics.s3.throttles.h" + i, throttles);
metrics.put("elasticsearch.metrics.s3.throttles_histogram_" + i, throttles);
}
}
logger.debug(new ESLogMessage().withFields(metrics));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ setup:
body: >
{
"persistent": {
"logger.org.elasticsearch.index": "TRACE"
"logger.org.elasticsearch.index": "TRACE",
"logger.org.elasticsearch.action.admin.indices.mapping.get": "TRACE",
"logger.org.elasticsearch.cluster.service.ClusterApplierService": "TRACE"
}
}
Expand All @@ -24,7 +26,9 @@ teardown:
body: >
{
"persistent": {
"logger.org.elasticsearch.index": null
"logger.org.elasticsearch.index": null,
"logger.org.elasticsearch.action.admin.indices.mapping.get": null,
"logger.org.elasticsearch.cluster.service.ClusterApplierService": null
}
}
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ setup:

---
"pre_filter_shard_size with shards that have no hit":
- skip:
version: all
reason: "AwaitsFix https://github.com/elastic/elasticsearch/issues/92058"
- do:
index:
index: index_1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,11 @@ teardown:
snapshot: test_restore_tsdb
wait_for_completion: true

# Check recovery stats
# Verify that the index is healthy
- do:
indices.recovery:
index: test_index

- match: { test_index.shards.0.type: SNAPSHOT }
- match: { test_index.shards.0.stage: DONE }
- match: { test_index.shards.0.index.files.recovered: 1}
- gt: { test_index.shards.0.index.size.recovered_in_bytes: 0}
cluster.health:
wait_for_status: green
- match: { status: green }

- do:
search:
Expand Down
Loading

0 comments on commit 13a0822

Please sign in to comment.