Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…fix_CsvTestsDataLoader_classLoading
  • Loading branch information
astefan committed Jun 18, 2024
2 parents f6e2f75 + 44f5968 commit 68b4ee0
Show file tree
Hide file tree
Showing 133 changed files with 2,704 additions and 2,140 deletions.
5 changes: 5 additions & 0 deletions docs/changelog/109487.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 109487
summary: Start Trained Model Deployment API request query params now override body params
area: Machine Learning
type: bug
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/109551.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 109551
summary: Avoid `InferenceRunner` deadlock
area: Machine Learning
type: bug
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/109651.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 109651
summary: Support synthetic source for `geo_point` when `ignore_malformed` is used
area: Mapping
type: enhancement
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/109794.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 109794
summary: Provide document size reporter with `MapperService`
area: Infra/Metrics
type: bug
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/109824.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 109824
summary: Check array size before returning array item in script doc values
area: Infra/Scripting
type: bug
issues:
- 104998
19 changes: 19 additions & 0 deletions docs/reference/esql/functions/kibana/inline_cast.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions docs/reference/mapping/types/geo-point.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`geo_point` fields support <<synthetic-source,synthetic `_source`>> in their
default configuration. Synthetic `_source` cannot be used together with
<<ignore-malformed,`ignore_malformed`>>, <<copy-to,`copy_to`>>, or with
default configuration. Synthetic `_source` cannot be used together with <<copy-to,`copy_to`>> or with
<<doc-values,`doc_values`>> disabled.

Synthetic source always sorts `geo_point` fields (first by latitude and then
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/rest-api/common-parms.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ Return all statistics.
`completion`::
<<completion-suggester,Completion suggester>> statistics.

`dense_vector`::
Total number of dense vectors indexed.
<<indices-refresh,Index refreshes>> can affect this statistic.

`docs`::
Number of documents, number of deleted docs which have not yet merged out, and total size in bytes.
<<indices-refresh,Index refreshes>> can affect this statistic.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

package org.elasticsearch.xcontent;

import java.io.IOException;

/**
* A parser that copies data that was parsed into a {@link XContentBuilder}.
* This parser naturally has some memory and runtime overhead to perform said copying.
* Use with {@link XContentSubParser} to preserve the entire object.
*/
public class CopyingXContentParser extends FilterXContentParserWrapper {
private final XContentBuilder builder;

public CopyingXContentParser(XContentParser delegate) throws IOException {
super(delegate);
this.builder = XContentBuilder.builder(delegate.contentType().xContent());
switch (delegate.currentToken()) {
case START_OBJECT -> builder.startObject();
case START_ARRAY -> builder.startArray();
default -> throw new IllegalArgumentException(
"can only copy parsers pointed to START_OBJECT or START_ARRAY but found: " + delegate.currentToken()
);
}
}

@Override
public Token nextToken() throws IOException {
XContentParser.Token next = delegate().nextToken();
builder.copyCurrentEvent(delegate());
return next;
}

public XContentBuilder getBuilder() {
return builder;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,18 @@ public XContentBuilder rawValue(String value) throws IOException {
return this;
}

/**
* Copies current event from parser into this builder.
* The difference with {@link XContentBuilder#copyCurrentStructure(XContentParser)}
* is that this method does not copy sub-objects as a single entity.
* @param parser
* @throws IOException
*/
public XContentBuilder copyCurrentEvent(XContentParser parser) throws IOException {
generator.copyCurrentEvent(parser);
return this;
}

public XContentBuilder copyCurrentStructure(XContentParser parser) throws IOException {
generator.copyCurrentStructure(parser);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.elasticsearch.action.ingest.PutPipelineRequest;
import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.index.IndexMode;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.ingest.common.IngestCommonPlugin;
import org.elasticsearch.plugins.IngestPlugin;
import org.elasticsearch.plugins.Plugin;
Expand Down Expand Up @@ -102,7 +102,7 @@ public DocumentSizeObserver newDocumentSizeObserver() {
@Override
public DocumentSizeReporter newDocumentSizeReporter(
String indexName,
IndexMode indexMode,
MapperService mapperService,
DocumentSizeAccumulator documentSizeAccumulator
) {
return DocumentSizeReporter.EMPTY_INSTANCE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -379,18 +378,18 @@ private LegacyGeoShapeParser() {}
public void parse(
XContentParser parser,
CheckedConsumer<ShapeBuilder<?, ?, ?>, IOException> consumer,
Consumer<Exception> onMalformed
MalformedValueHandler malformedHandler
) throws IOException {
try {
if (parser.currentToken() == XContentParser.Token.START_ARRAY) {
while (parser.nextToken() != XContentParser.Token.END_ARRAY) {
parse(parser, consumer, onMalformed);
parse(parser, consumer, malformedHandler);
}
} else {
consumer.accept(ShapeParser.parse(parser));
}
} catch (ElasticsearchParseException e) {
onMalformed.accept(e);
malformedHandler.notify(e);
}
}

Expand Down
15 changes: 12 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ tests:
method: "testGuessIsDayFirstFromLocale"
- class: "org.elasticsearch.test.rest.ClientYamlTestSuiteIT"
issue: "https://github.com/elastic/elasticsearch/issues/108857"
method: "test {yaml=search/180_locale_dependent_mapping/Test Index and Search locale dependent mappings / dates}"
method: "test {yaml=search/180_locale_dependent_mapping/Test Index and Search locale\
\ dependent mappings / dates}"
- class: "org.elasticsearch.upgrades.SearchStatesIT"
issue: "https://github.com/elastic/elasticsearch/issues/108991"
method: "testCanMatch"
Expand All @@ -19,7 +20,8 @@ tests:
method: "testTrainedModelInference"
- class: "org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT"
issue: "https://github.com/elastic/elasticsearch/issues/109188"
method: "test {yaml=search/180_locale_dependent_mapping/Test Index and Search locale dependent mappings / dates}"
method: "test {yaml=search/180_locale_dependent_mapping/Test Index and Search locale\
\ dependent mappings / dates}"
- class: "org.elasticsearch.xpack.esql.qa.mixed.EsqlClientYamlIT"
issue: "https://github.com/elastic/elasticsearch/issues/109189"
method: "test {p0=esql/70_locale/Date format with Italian locale}"
Expand All @@ -34,7 +36,8 @@ tests:
method: "testTimestampFieldTypeExposedByAllIndicesServices"
- class: "org.elasticsearch.analysis.common.CommonAnalysisClientYamlTestSuiteIT"
issue: "https://github.com/elastic/elasticsearch/issues/109318"
method: "test {yaml=analysis-common/50_char_filters/pattern_replace error handling (too complex pattern)}"
method: "test {yaml=analysis-common/50_char_filters/pattern_replace error handling\
\ (too complex pattern)}"
- class: "org.elasticsearch.xpack.ml.integration.ClassificationHousePricingIT"
issue: "https://github.com/elastic/elasticsearch/issues/101598"
method: "testFeatureImportanceValues"
Expand All @@ -61,6 +64,12 @@ tests:
- class: org.elasticsearch.action.search.SearchProgressActionListenerIT
method: testSearchProgressWithHits
issue: https://github.com/elastic/elasticsearch/issues/109830
- class: "org.elasticsearch.xpack.shutdown.NodeShutdownReadinessIT"
issue: "https://github.com/elastic/elasticsearch/issues/109838"
method: "testShutdownReadinessService"
- class: "org.elasticsearch.cluster.PrevalidateShardPathIT"
issue: "https://github.com/elastic/elasticsearch/issues/104807"
method: "testCheckShards"

# Examples:
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public void test50Remove() throws Exception {
}

assertThat(sh.runIgnoreExitCode("systemctl status elasticsearch.service").exitCode(), is(statusExitCode));
assertThat(sh.runIgnoreExitCode("systemctl is-enabled elasticsearch.service").exitCode(), is(1));
assertThat(sh.runIgnoreExitCode("systemctl is-enabled elasticsearch.service").exitCode(), not(0));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import static org.elasticsearch.packaging.util.Packages.verifyPackageInstallation;
import static org.elasticsearch.packaging.util.Platforms.isSystemd;
import static org.elasticsearch.packaging.util.ServerUtils.enableGeoIpDownloader;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.Matchers.not;
import static org.junit.Assume.assumeTrue;

public class RpmPreservationTests extends PackagingTestCase {
Expand Down Expand Up @@ -78,7 +78,7 @@ public void test30PreserveConfig() throws Exception {
assertRemoved(distribution());

if (isSystemd()) {
assertThat(sh.runIgnoreExitCode("systemctl is-enabled elasticsearch.service").exitCode(), is(1));
assertThat(sh.runIgnoreExitCode("systemctl is-enabled elasticsearch.service").exitCode(), not(0));
}

assertPathsDoNotExist(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ public void testScriptByteVectorSearch() throws Exception {
""";
createIndex(SCRIPT_BYTE_INDEX_NAME, Settings.EMPTY, mapping);
indexVectors(SCRIPT_BYTE_INDEX_NAME);
// refresh the index
client().performRequest(new Request("POST", "/" + SCRIPT_BYTE_INDEX_NAME + "/_refresh"));
}
// search with a script query
Request searchRequest = new Request("POST", "/" + SCRIPT_BYTE_INDEX_NAME + "/_search");
Expand Down Expand Up @@ -107,8 +105,6 @@ public void testScriptVectorSearch() throws Exception {
""";
createIndex(SCRIPT_VECTOR_INDEX_NAME, Settings.EMPTY, mapping);
indexVectors(SCRIPT_VECTOR_INDEX_NAME);
// refresh the index
client().performRequest(new Request("POST", "/" + SCRIPT_VECTOR_INDEX_NAME + "/_refresh"));
}
// search with a script query
Request searchRequest = new Request("POST", "/" + SCRIPT_VECTOR_INDEX_NAME + "/_search");
Expand Down Expand Up @@ -237,7 +233,6 @@ public void testByteVectorSearch() throws Exception {
// create index and index 10 random floating point vectors
createIndex(BYTE_INDEX_NAME, Settings.EMPTY, mapping);
indexVectors(BYTE_INDEX_NAME);
// refresh the index
// force merge the index
client().performRequest(new Request("POST", "/" + BYTE_INDEX_NAME + "/_forcemerge?max_num_segments=1"));
}
Expand Down Expand Up @@ -448,6 +443,8 @@ private void indexVectors(String indexName) throws Exception {
indexRequest.setJsonEntity(vectors[i]);
assertOK(client().performRequest(indexRequest));
}
// always refresh to ensure the data is visible
refresh(indexName);
}

private static Map<String, Object> search(Request request) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,12 @@
---
"Dense vector stats":
- requires:
cluster_features: [ "gte_v8.10.0" ]
reason: "dense vector stats added in 8.10"
cluster_features: [ "gte_v8.15.0" ]
reason: "dense vector stats reports from primary indices in 8.15"
- do:
indices.create:
index: test1
body:
settings:
number_of_replicas: 0
mappings:
properties:
vector:
Expand All @@ -283,8 +281,6 @@
indices.create:
index: test2
body:
settings:
number_of_replicas: 0
mappings:
properties:
vector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@
- exists: indicators.shards_availability.details.started_primaries
- exists: indicators.shards_availability.details.unassigned_replicas

- match: { indicators.shards_capacity.status: "green" }
- match: { indicators.shards_capacity.symptom: "The cluster has enough room to add new shards." }
- exists: indicators.shards_capacity.details.data.max_shards_in_cluster
- exists: indicators.shards_capacity.details.frozen.max_shards_in_cluster
# The shards_availability indicator is dependent on HealthMetadata being present in the cluster state, which we can't guarantee.
- is_true: indicators.shards_capacity.status
- is_true: indicators.shards_capacity.symptom

- is_true: indicators.data_stream_lifecycle.status
- is_true: indicators.data_stream_lifecycle.symptom
Loading

0 comments on commit 68b4ee0

Please sign in to comment.