Skip to content

Commit

Permalink
Merge branch 'main' into coalesce
Browse files Browse the repository at this point in the history
  • Loading branch information
nik9000 committed Aug 17, 2023
2 parents eb19d9a + af071cc commit f457f3d
Show file tree
Hide file tree
Showing 124 changed files with 3,027 additions and 1,664 deletions.
6 changes: 6 additions & 0 deletions docs/changelog/98574.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 98574
summary: Specify correct current `IndexVersion` after 8.10 release
area: Infra/Core
type: bug
issues:
- 98555
2 changes: 0 additions & 2 deletions docs/reference/esql/esql-functions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ these functions:
* <<esql-is_finite>>
* <<esql-is_infinite>>
* <<esql-is_nan>>
* <<esql-is_null>>
* <<esql-length>>
* <<esql-log10>>
* <<esql-mv_avg>>
Expand Down Expand Up @@ -86,7 +85,6 @@ include::functions/floor.asciidoc[]
include::functions/is_finite.asciidoc[]
include::functions/is_infinite.asciidoc[]
include::functions/is_nan.asciidoc[]
include::functions/is_null.asciidoc[]
include::functions/length.asciidoc[]
include::functions/log10.asciidoc[]
include::functions/mv_avg.asciidoc[]
Expand Down
24 changes: 24 additions & 0 deletions docs/reference/esql/esql-syntax.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,30 @@ The following boolean operators are supported:
* `OR`
* `NOT`

[discrete]
[[esql-predicates]]
=== Predicates

For NULL comparison use the `IS NULL` and `IS NOT NULL` predicates:

[source.merge.styled,esql]
----
include::{esql-specs}/null.csv-spec[tag=is-null]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/null.csv-spec[tag=is-not-null-result]
|===

[source.merge.styled,esql]
----
include::{esql-specs}/null.csv-spec[tag=is-not-null]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/null.csv-spec[tag=is-not-null-result]
|===

[discrete]
[[esql-timespan-literals]]
=== Timespan literals
Expand Down
23 changes: 0 additions & 23 deletions docs/reference/esql/functions/is_null.asciidoc

This file was deleted.

4 changes: 2 additions & 2 deletions docs/reference/indices/shard-stores.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ The API returns the following response:
// TESTRESPONSE[s/"attributes": \{[^}]*\}/"attributes": $body.$_path/]
// TESTRESPONSE[s/"roles": \[[^]]*\]/"roles": $body.$_path/]
// TESTRESPONSE[s/"8.10.0"/\$node_version/]
// TESTRESPONSE[s/"7000099"/"\d+"/]
// TESTRESPONSE[s/"8100099"/"\d+"/]
// TESTRESPONSE[s/"min_index_version": 7000099/"min_index_version": $body.$_path/]
// TESTRESPONSE[s/"max_index_version": 8100099/"max_index_version": $body.$_path/]



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ PUT /_query_rules/my-ruleset
"criteria": [
{
"type": "fuzzy",
"metadata": "user.query",
"metadata": "query_string",
"values": [ "puggles", "pugs" ]
},
{
Expand All @@ -148,8 +148,8 @@ PUT /_query_rules/my-ruleset
"type": "pinned",
"criteria": [
{
"type": "fuzzy",
"metadata": "user.query",
"type": "contains",
"metadata": "query_string",
"values": [ "beagles" ]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@

public class IngestGeoIpPlugin extends Plugin implements IngestPlugin, SystemIndexPlugin, Closeable, PersistentTaskPlugin, ActionPlugin {
public static final Setting<Long> CACHE_SIZE = Setting.longSetting("ingest.geoip.cache_size", 1000, 0, Setting.Property.NodeScope);
private static final int GEOIP_INDEX_MAPPINGS_VERSION = 1;

private final SetOnce<IngestService> ingestService = new SetOnce<>();
private final SetOnce<DatabaseNodeService> databaseRegistry = new SetOnce<>();
Expand Down Expand Up @@ -222,6 +223,7 @@ private static XContentBuilder mappings() {
.startObject(SINGLE_MAPPING_NAME)
.startObject("_meta")
.field("version", Version.CURRENT)
.field(SystemIndexDescriptor.VERSION_META_KEY, GEOIP_INDEX_MAPPINGS_VERSION)
.endObject()
.field("dynamic", "strict")
.startObject("properties")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ static String createMapping(boolean descriptorManaged, boolean descriptorInterna
{
builder.startObject("_meta");
builder.field(VERSION_META_KEY, META_VERSION);
builder.field(SystemIndexDescriptor.VERSION_META_KEY, 1);
builder.field(DESCRIPTOR_MANAGED_META_KEY, descriptorManaged);
builder.field(DESCRIPTOR_INTERNAL_META_KEY, descriptorInternal);
builder.endObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ public Collection<SystemIndexDescriptor> getSystemIndexDescriptors(Settings sett
{
builder.startObject("_meta");
builder.field("version", Version.CURRENT.toString());
builder.field(SystemIndexDescriptor.VERSION_META_KEY, 1);
builder.endObject();

builder.field("dynamic", "strict");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ private static XContentBuilder mappings() {
.startObject(SINGLE_MAPPING_NAME)
.startObject("_meta")
.field("version", Version.CURRENT)
.field(SystemIndexDescriptor.VERSION_META_KEY, 1)
.endObject()
.field("dynamic", "strict")
.startObject("properties")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.elasticsearch.cluster.metadata.Template;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.indices.TestSystemIndexDescriptor;
import org.elasticsearch.indices.TestSystemIndexDescriptorAllowsTemplates;
import org.elasticsearch.indices.TestSystemIndexPlugin;
Expand All @@ -38,8 +39,6 @@
import org.junit.After;
import org.junit.Before;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
Expand All @@ -51,7 +50,6 @@

import static org.elasticsearch.indices.TestSystemIndexDescriptor.INDEX_NAME;
import static org.elasticsearch.indices.TestSystemIndexDescriptor.PRIMARY_INDEX_NAME;
import static org.elasticsearch.test.XContentTestUtils.convertToXContent;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
Expand Down Expand Up @@ -352,7 +350,6 @@ private void assertHasAliases(Set<String> aliasNames, String name, String primar

/**
* Fetch the mappings and settings for {@link TestSystemIndexDescriptor#INDEX_NAME} and verify that they match the expected values.
* Note that in the case of the mappings, this is just a dumb string comparison, so order of keys matters.
*/
private void assertMappingsAndSettings(String expectedMappings, String concreteIndex) {
final GetMappingsResponse getMappingsResponse = indicesAdmin().getMappings(new GetMappingsRequest().indices(INDEX_NAME))
Expand All @@ -366,11 +363,7 @@ private void assertMappingsAndSettings(String expectedMappings, String concreteI
);
final Map<String, Object> sourceAsMap = mappings.get(concreteIndex).getSourceAsMap();

try {
assertThat(convertToXContent(sourceAsMap, XContentType.JSON).utf8ToString(), equalTo(expectedMappings));
} catch (IOException e) {
throw new UncheckedIOException(e);
}
assertThat(sourceAsMap, equalTo(XContentHelper.convertToMap(XContentType.JSON.xContent(), expectedMappings, false)));

final GetSettingsResponse getSettingsResponse = indicesAdmin().getSettings(new GetSettingsRequest().indices(INDEX_NAME))
.actionGet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public Collection<SystemIndexDescriptor> getSystemIndexDescriptors(Settings sett
{
builder.startObject("_meta");
builder.field("version", Version.CURRENT.toString());
builder.field(SystemIndexDescriptor.VERSION_META_KEY, 1);
builder.endObject();

builder.field("dynamic", "strict");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,19 @@
import org.elasticsearch.cluster.metadata.MappingMetadata;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.xcontent.XContentType;
import org.junit.Before;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import static org.elasticsearch.indices.TestSystemIndexDescriptor.INDEX_NAME;
import static org.elasticsearch.indices.TestSystemIndexDescriptor.PRIMARY_INDEX_NAME;
import static org.elasticsearch.test.XContentTestUtils.convertToXContent;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.hamcrest.Matchers.equalTo;

Expand Down Expand Up @@ -122,7 +120,6 @@ private void triggerClusterStateUpdates() {

/**
* Fetch the mappings and settings for {@link TestSystemIndexDescriptor#INDEX_NAME} and verify that they match the expected values.
* Note that in the case of the mappings, this is just a dumb string comparison, so order of keys matters.
*/
private void assertMappingsAndSettings(String expectedMappings) {
final GetMappingsResponse getMappingsResponse = indicesAdmin().getMappings(new GetMappingsRequest().indices(INDEX_NAME))
Expand All @@ -136,11 +133,7 @@ private void assertMappingsAndSettings(String expectedMappings) {
);
final Map<String, Object> sourceAsMap = mappings.get(PRIMARY_INDEX_NAME).getSourceAsMap();

try {
assertThat(convertToXContent(sourceAsMap, XContentType.JSON).utf8ToString(), equalTo(expectedMappings));
} catch (IOException e) {
throw new UncheckedIOException(e);
}
assertThat(sourceAsMap, equalTo(XContentHelper.convertToMap(XContentType.JSON.xContent(), expectedMappings, false)));

final GetSettingsResponse getSettingsResponse = indicesAdmin().getSettings(new GetSettingsRequest().indices(INDEX_NAME))
.actionGet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public static String getOldMappings() {
builder.startObject();
{
builder.startObject("_meta");
builder.field(SystemIndexDescriptor.VERSION_META_KEY, 0);
builder.field("version", Version.CURRENT.previousMajor().toString());
builder.endObject();

Expand All @@ -123,6 +124,7 @@ public static String getNewMappings() {
builder.startObject();
{
builder.startObject("_meta");
builder.field(SystemIndexDescriptor.VERSION_META_KEY, 1);
builder.field("version", Version.CURRENT.toString());
builder.endObject();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.elasticsearch.search.DummyQueryBuilder;
import org.elasticsearch.search.SearchService;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.TransportVersionUtils;
import org.elasticsearch.xcontent.XContentType;

import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFirstHit;
Expand Down Expand Up @@ -86,6 +87,7 @@ public void testSimpleMultiSearchMoreRequests() {
* Test that triggering the CCS compatibility check with a query that shouldn't go to the minor before Version.CURRENT works
*/
public void testCCSCheckCompatibility() throws Exception {
TransportVersion transportVersion = TransportVersionUtils.getNextVersion(TransportVersion.MINIMUM_CCS_VERSION, true);
createIndex("test");
ensureGreen();
client().prepareIndex("test").setId("1").setSource("field", "xxx").get();
Expand All @@ -97,7 +99,7 @@ public void testCCSCheckCompatibility() throws Exception {
.add(client().prepareSearch("test").setQuery(new DummyQueryBuilder() {
@Override
public TransportVersion getMinimalSupportedVersion() {
return TransportVersion.current();
return transportVersion;
}
}))
.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static VersionInformation inferVersions(Version nodeVersion) {
return null;
} else if (nodeVersion.equals(Version.CURRENT)) {
return CURRENT;
} else if (nodeVersion.before(Version.V_8_10_0)) {
} else if (nodeVersion.onOrBefore(Version.V_8_10_0)) {
return new VersionInformation(
nodeVersion,
IndexVersion.fromId(nodeVersion.minimumIndexCompatibilityVersion().id),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private static IndexVersion registerIndexVersion(int id, Version luceneVersion,
* Detached index versions added below here.
*/
private static class CurrentHolder {
private static final IndexVersion CURRENT = findCurrent(V_8_10_0);
private static final IndexVersion CURRENT = findCurrent(V_8_11_0);

// finds the pluggable current version, or uses the given fallback
private static IndexVersion findCurrent(IndexVersion fallback) {
Expand Down
Loading

0 comments on commit f457f3d

Please sign in to comment.