From 40534ccabccd31ff7a30b197ccbba399f9e1de59 Mon Sep 17 00:00:00 2001 From: David Roberts Date: Fri, 25 May 2018 12:56:27 +0100 Subject: [PATCH 1/5] [TEST] Mute {p0=snapshot.get_repository/10_basic/Verify created repository} YAML test Issue is #30807 --- .../rest-api-spec/test/snapshot.get_repository/10_basic.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/snapshot.get_repository/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/snapshot.get_repository/10_basic.yml index b944fe43791e4..c70942f0c9d91 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/snapshot.get_repository/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/snapshot.get_repository/10_basic.yml @@ -51,6 +51,9 @@ setup: --- "Verify created repository": + - skip: + version: "all" + reason: AwaitsFix for https://github.com/elastic/elasticsearch/issues/30807 - do: snapshot.verify_repository: repository: test_repo_get_2 From 36fbb4cb48744c66a7466ec6d16812cda938d4ab Mon Sep 17 00:00:00 2001 From: Tom Callahan Date: Fri, 25 May 2018 09:41:16 -0400 Subject: [PATCH 2/5] Harmonize include_defaults tests (#30700) This PR breaks the include_defaults functionality of the get settings API into its own test, which is skipped for mixed-mode clusters containing pre-6.4 nodes. --- .../test/indices.get_settings/30_defaults.yml | 28 +++++++++++++++++++ .../test/indices.put_settings/11_reset.yml | 12 -------- 2 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml new file mode 100644 index 0000000000000..2e3f4af03ebef --- /dev/null +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml @@ -0,0 +1,28 @@ +--- +setup: + - do: + indices.create: + body: + settings: + index: + number_of_shards: 1 + number_of_replicas: 1 + index: test-index +--- +Test retrieval of default settings: + - skip: + version: " - 6.3.99" + reason: include_defaults will not work in mixed-mode clusters containing nodes pre-6.4 + - do: + indices.get_settings: + flat_settings: true + index: test-index + - is_false: + test-index.settings.index\.refresh_interval + - do: + indices.get_settings: + include_defaults: true + flat_settings: true + index: test-index + - match: + test-index.defaults.index\.refresh_interval: "1s" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_settings/11_reset.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_settings/11_reset.yml index d7bd87cc73a82..ac5564fcd3ec4 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_settings/11_reset.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_settings/11_reset.yml @@ -23,15 +23,3 @@ Test reset index settings: indices.get_settings: flat_settings: false - is_false: test-index.settings.index\.refresh_interval - -# Disabled until https://github.com/elastic/elasticsearch/pull/29229 is back-ported -# That PR changed the execution path of index settings default to be on the master -# until the PR is back-ported the old master will not return default settings. -# -# - do: -# indices.get_settings: -# include_defaults: true -# flat_settings: true -# index: test-index -# - match: -# test-index.defaults.index\.refresh_interval: "1s" From 6909a05f3d4c5c26711b1a8c8a36bb32762cc963 Mon Sep 17 00:00:00 2001 From: Zachary Tong Date: Fri, 25 May 2018 10:21:09 -0400 Subject: [PATCH 3/5] [DOCS] Document index name limitations (#30826) Also tidy up the docs a bit, there's no yaml example anymore, etc --- docs/reference/indices/create-index.asciidoc | 50 +++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/docs/reference/indices/create-index.asciidoc b/docs/reference/indices/create-index.asciidoc index 32a454624990c..ade591536440c 100644 --- a/docs/reference/indices/create-index.asciidoc +++ b/docs/reference/indices/create-index.asciidoc @@ -1,16 +1,39 @@ [[indices-create-index]] == Create Index -The create index API allows to instantiate an index. Elasticsearch -provides support for multiple indices, including executing operations -across several indices. +The Create Index API is used to manually create an index in Elasticsearch. All documents in Elasticsearch +are stored inside of one index or another. + +The most basic command is the following: + +[source,js] +-------------------------------------------------- +PUT twitter +-------------------------------------------------- +// CONSOLE + +This create an index named `twitter` with all default setting. + +[NOTE] +.Index name limitations +====================================================== +There are several limitations to what you can name your index. The complete list of limitations are: + +- Lowercase only +- Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, ` ` (space character), `,`, `#` +- Indices prior to 7.0 could contain a colon (`:`), but that's been deprecated and won't be supported in 7.0+ +- Cannot start with `-`, `_`, `+` +- Cannot be `.` or ``..` +- Cannot be longer than 255 bytes (note it is bytes, so multi-byte characters will count towards the 255 limit faster) + +====================================================== [float] [[create-index-settings]] === Index Settings Each index created can have specific settings -associated with it. +associated with it, defined in the body: [source,js] -------------------------------------------------- @@ -28,25 +51,6 @@ PUT twitter <1> Default for `number_of_shards` is 1 <2> Default for `number_of_replicas` is 1 (ie one replica for each primary shard) -The above second curl example shows how an index called `twitter` can be -created with specific settings for it using http://www.yaml.org[YAML]. -In this case, creating an index with 3 shards, each with 2 replicas. The -index settings can also be defined with http://www.json.org[JSON]: - -[source,js] --------------------------------------------------- -PUT twitter -{ - "settings" : { - "index" : { - "number_of_shards" : 3, - "number_of_replicas" : 2 - } - } -} --------------------------------------------------- -// CONSOLE - or more simplified [source,js] From e08c7c2df44dd5eea6313eea7bb8026f7f763903 Mon Sep 17 00:00:00 2001 From: Michael Basnight Date: Fri, 25 May 2018 10:09:09 -0500 Subject: [PATCH 4/5] Change BWC version for VerifyRepositoryResponse (#30796) The BWC version was previously at 7.0, because the 6.x backport had not yet landed. Now that it has landed, this commit replaces the BWC compat with the real version, 6.4.0. Relates #30762 --- .../cluster/repositories/verify/VerifyRepositoryResponse.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java index b399923b2025b..d5cc0b6f95728 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java @@ -140,7 +140,7 @@ public VerifyRepositoryResponse(ClusterName clusterName, DiscoveryNode[] nodes) @Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); - if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { + if (in.getVersion().onOrAfter(Version.V_6_4_0)) { this.nodes = in.readList(NodeView::new).stream().map(n -> n.convertToDiscoveryNode()).collect(Collectors.toList()); } else { clusterName = new ClusterName(in); @@ -151,7 +151,7 @@ public void readFrom(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { + if (out.getVersion().onOrAfter(Version.V_6_4_0)) { out.writeList(getNodes()); } else { clusterName.writeTo(out); From dcff63e69c7b37bf7bf2e5b2a5b983a406199dc2 Mon Sep 17 00:00:00 2001 From: Tim Brooks Date: Fri, 25 May 2018 10:19:04 -0600 Subject: [PATCH 5/5] Do not serialize basic license exp in x-pack info (#30848) This is a bug that was identified by the kibana team. Currently on a get-license call we do not serialize the hard-coded expiration for basic licenses. However, the kibana team calls the x-pack info route which still does serialize the expiration date. This commit removes that serialization in the rest response. --- .../elasticsearch/license/XPackInfoResponse.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackInfoResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackInfoResponse.java index 7c2886345470c..4d5c90ada4960 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackInfoResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackInfoResponse.java @@ -123,13 +123,15 @@ public License.Status getStatus() { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - return builder.startObject() - .field("uid", uid) - .field("type", type) - .field("mode", mode) - .field("status", status.label()) - .timeField("expiry_date_in_millis", "expiry_date", expiryDate) - .endObject(); + builder.startObject() + .field("uid", uid) + .field("type", type) + .field("mode", mode) + .field("status", status.label()); + if (expiryDate != LicenseService.BASIC_SELF_GENERATED_LICENSE_EXPIRATION_MILLIS) { + builder.timeField("expiry_date_in_millis", "expiry_date", expiryDate); + } + return builder.endObject(); } public void writeTo(StreamOutput out) throws IOException {