Skip to content

Commit 7c64ba7

Browse files
committed
Merge branch 'master' into zendisco2
2 parents eb51407 + d68c44b commit 7c64ba7

File tree

60 files changed

+1026
-238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1026
-238
lines changed

TESTING.asciidoc

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,46 @@ run it using Gradle:
2525
./gradlew run
2626
-------------------------------------
2727

28+
==== Launching and debugging from an IDE
29+
30+
If you want to run Elasticsearch from your IDE, the `./gradlew run` task
31+
supports a remote debugging option:
32+
33+
---------------------------------------------------------------------------
34+
./gradlew run --debug-jvm
35+
---------------------------------------------------------------------------
36+
37+
==== Distribution
38+
39+
By default a node is started with the zip distribution.
40+
In order to start with a different distribution use the `-Drun.distribution` argument.
41+
42+
To for example start the open source distribution:
43+
44+
-------------------------------------
45+
./gradlew run -Drun.distribution=oss-zip
46+
-------------------------------------
47+
48+
==== License type
49+
50+
By default a node is started with the `basic` license type.
51+
In order to start with a different license type use the `-Drun.license_type` argument.
52+
53+
In order to start a node with a trial license execute the following command:
54+
55+
-------------------------------------
56+
./gradlew run -Drun.license_type=trial
57+
-------------------------------------
58+
59+
This enables security and other paid features and adds a superuser with the username: `elastic-admin` and
60+
password: `elastic-password`.
61+
62+
==== Other useful arguments
63+
64+
In order to start a node with a different max heap space add: `-Dtests.heap.size=4G`
65+
In order to disable annotations add: `-Dtests.asserts=false`
66+
In order to set an Elasticsearch setting, provide a setting with the following prefix: `-Dtests.es.`
67+
2868
=== Test case filtering.
2969

3070
- `tests.class` is a class-filtering shell-like glob pattern,
@@ -572,15 +612,6 @@ as its build system. Since the switch to Gradle though, this is no longer possib
572612
the code currently used to build Elasticsearch does not allow JaCoCo to recognize its tests.
573613
For more information on this, see the discussion in https://github.com/elastic/elasticsearch/issues/28867[issue #28867].
574614

575-
== Launching and debugging from an IDE
576-
577-
If you want to run Elasticsearch from your IDE, the `./gradlew run` task
578-
supports a remote debugging option:
579-
580-
---------------------------------------------------------------------------
581-
./gradlew run --debug-jvm
582-
---------------------------------------------------------------------------
583-
584615
== Debugging remotely from an IDE
585616

586617
If you want to run Elasticsearch and be able to remotely attach the process

client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesClientIT.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,12 @@ public void testShrink() throws IOException {
642642

643643
ResizeRequest resizeRequest = new ResizeRequest("target", "source");
644644
resizeRequest.setResizeType(ResizeType.SHRINK);
645-
Settings targetSettings = Settings.builder().put("index.number_of_shards", 2).put("index.number_of_replicas", 0).build();
645+
Settings targetSettings =
646+
Settings.builder()
647+
.put("index.number_of_shards", 2)
648+
.put("index.number_of_replicas", 0)
649+
.putNull("index.routing.allocation.require._name")
650+
.build();
646651
resizeRequest.setTargetIndex(new CreateIndexRequest("target").settings(targetSettings).alias(new Alias("alias")));
647652
ResizeResponse resizeResponse = highLevelClient().indices().shrink(resizeRequest);
648653
assertTrue(resizeResponse.isAcknowledged());

client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/IndicesClientDocumentationIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,8 @@ public void testShrinkIndex() throws Exception {
13051305
// end::shrink-index-request-waitForActiveShards
13061306
// tag::shrink-index-request-settings
13071307
request.getTargetIndexRequest().settings(Settings.builder()
1308-
.put("index.number_of_shards", 2)); // <1>
1308+
.put("index.number_of_shards", 2) // <1>
1309+
.putNull("index.routing.allocation.require._name")); // <2>
13091310
// end::shrink-index-request-settings
13101311
// tag::shrink-index-request-aliases
13111312
request.getTargetIndexRequest().alias(new Alias("target_alias")); // <1>

distribution/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,14 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
310310
task run(type: RunTask) {
311311
distribution = System.getProperty('run.distribution', 'zip')
312312
if (distribution == 'zip') {
313-
String licenseType = System.getProperty("license_type", "basic")
313+
String licenseType = System.getProperty("run.license_type", "basic")
314314
if (licenseType == 'trial') {
315315
setting 'xpack.ml.enabled', 'true'
316316
setting 'xpack.graph.enabled', 'true'
317317
setting 'xpack.watcher.enabled', 'true'
318318
setting 'xpack.license.self_generated.type', 'trial'
319+
setupCommand 'setupTestAdmin',
320+
'bin/elasticsearch-users', 'useradd', 'elastic-admin', '-p', 'elastic-password', '-r', 'superuser'
319321
} else if (licenseType != 'basic') {
320322
throw new IllegalArgumentException("Unsupported self-generated license type: [" + licenseType + "[basic] or [trial].")
321323
}

docs/java-rest/high-level/indices/shrink_index.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ returns a response, as an `ActiveShardCount`
4545
--------------------------------------------------
4646
include-tagged::{doc-tests}/IndicesClientDocumentationIT.java[shrink-index-request-settings]
4747
--------------------------------------------------
48-
<1> The settings to apply to the target index, which include the number of
49-
shards to create for it
48+
<1> The number of shards on the target of the shrink index request
49+
<2> Remove the allocation requirement copied from the source index
5050

5151
["source","java",subs="attributes,callouts,macros"]
5252
--------------------------------------------------

docs/reference/indices/shrink-index.asciidoc

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ the following request:
6262

6363
[source,js]
6464
--------------------------------------------------
65-
POST my_source_index/_shrink/my_target_index?copy_settings=true
65+
POST my_source_index/_shrink/my_target_index
6666
{
6767
"settings": {
6868
"index.routing.allocation.require._name": null, <1>
@@ -106,7 +106,7 @@ and accepts `settings` and `aliases` parameters for the target index:
106106

107107
[source,js]
108108
--------------------------------------------------
109-
POST my_source_index/_shrink/my_target_index?copy_settings=true
109+
POST my_source_index/_shrink/my_target_index
110110
{
111111
"settings": {
112112
"index.number_of_replicas": 1,
@@ -130,16 +130,6 @@ POST my_source_index/_shrink/my_target_index?copy_settings=true
130130

131131
NOTE: Mappings may not be specified in the `_shrink` request.
132132

133-
NOTE: By default, with the exception of `index.analysis`, `index.similarity`,
134-
and `index.sort` settings, index settings on the source index are not copied
135-
during a shrink operation. With the exception of non-copyable settings, settings
136-
from the source index can be copied to the target index by adding the URL
137-
parameter `copy_settings=true` to the request. Note that `copy_settings` can not
138-
be set to `false`. The parameter `copy_settings` will be removed in 8.0.0
139-
140-
deprecated[6.4.0, not copying settings is deprecated, copying settings will be
141-
the default behavior in 7.x]
142-
143133
[float]
144134
=== Monitoring the shrink process
145135

docs/reference/indices/split-index.asciidoc

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ the following request:
123123

124124
[source,js]
125125
--------------------------------------------------
126-
POST my_source_index/_split/my_target_index?copy_settings=true
126+
POST my_source_index/_split/my_target_index
127127
{
128128
"settings": {
129129
"index.number_of_shards": 2
@@ -158,7 +158,7 @@ and accepts `settings` and `aliases` parameters for the target index:
158158

159159
[source,js]
160160
--------------------------------------------------
161-
POST my_source_index/_split/my_target_index?copy_settings=true
161+
POST my_source_index/_split/my_target_index
162162
{
163163
"settings": {
164164
"index.number_of_shards": 5 <1>
@@ -177,16 +177,6 @@ POST my_source_index/_split/my_target_index?copy_settings=true
177177

178178
NOTE: Mappings may not be specified in the `_split` request.
179179

180-
NOTE: By default, with the exception of `index.analysis`, `index.similarity`,
181-
and `index.sort` settings, index settings on the source index are not copied
182-
during a split operation. With the exception of non-copyable settings, settings
183-
from the source index can be copied to the target index by adding the URL
184-
parameter `copy_settings=true` to the request. Note that `copy_settings` can not
185-
be set to `false`. The parameter `copy_settings` will be removed in 8.0.0
186-
187-
deprecated[6.4.0, not copying settings is deprecated, copying settings will be
188-
the default behavior in 7.x]
189-
190180
[float]
191181
=== Monitoring the split process
192182

docs/reference/migration/migrate_7_0/api.asciidoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,13 @@ deprecated in 6.3.0 and now removed in 7.0.0.
6565
In the past, `fields` could be provided either as a parameter, or as part of the request
6666
body. Specifying `fields` in the request body as opposed to a parameter was deprecated
6767
in 6.4.0, and is now unsupported in 7.0.0.
68+
69+
==== `copy_settings` is deprecated on shrink and split APIs
70+
71+
Versions of Elasticsearch prior to 6.4.0 did not copy index settings on shrink
72+
and split operations. Starting with Elasticsearch 7.0.0, the default behavior
73+
will be for such settings to be copied on such operations. To enable users in
74+
6.4.0 to transition in 6.4.0 to the default behavior in 7.0.0, the
75+
`copy_settings` parameter was added on the REST layer. As this behavior will be
76+
the only behavior in 8.0.0, this parameter is deprecated in 7.0.0 for removal in
77+
8.0.0.

docs/reference/setup/install/windows.asciidoc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ part of the installation, with the option to configure a HTTPS proxy through whi
7979
[[msi-installer-selected-plugins]]
8080
image::images/msi_installer/msi_installer_selected_plugins.png[]
8181

82-
Upon choosing to install X-Pack plugin, an additional step allows a choice of the type of X-Pack
83-
license to install, in addition to X-Pack Security configuration and built-in user configuration:
82+
Upon choosing to install {xpack} plugin, an additional step allows a choice of the type of {xpack}
83+
license to install, in addition to {security} configuration and built-in user configuration:
8484

8585
[[msi-installer-xpack]]
8686
image::images/msi_installer/msi_installer_xpack.png[]
8787

88-
NOTE: X-Pack includes a choice of a Trial or Basic license for 30 days. After that, you can obtain one of the
88+
NOTE: {xpack} includes a choice of a Trial or Basic license for 30 days. After that, you can obtain one of the
8989
https://www.elastic.co/subscriptions[available subscriptions] or {ref}/security-settings.html[disable Security].
9090
The Basic license is free and includes the https://www.elastic.co/products/x-pack/monitoring[Monitoring] extension.
9191

@@ -286,43 +286,43 @@ as _properties_ within Windows Installer documentation) that can be passed to ms
286286

287287
`XPACKLICENSE`::
288288

289-
When installing X-Pack plugin, the type of license to install,
289+
When installing {xpack} plugin, the type of license to install,
290290
either `Basic` or `Trial`. Defaults to `Basic`
291291

292292
`XPACKSECURITYENABLED`::
293293

294-
When installing X-Pack plugin with a `Trial` license, whether X-Pack Security should be enabled.
294+
When installing {xpack} plugin with a `Trial` license, whether {security} should be enabled.
295295
Defaults to `true`
296296

297297
`BOOTSTRAPPASSWORD`::
298298

299-
When installing X-Pack plugin with a `Trial` license and X-Pack Security enabled, the password to
299+
When installing {xpack} plugin with a `Trial` license and {security} enabled, the password to
300300
used to bootstrap the cluster and persisted as the `bootstrap.password` setting in the keystore.
301301
Defaults to a randomized value.
302302

303303
`SKIPSETTINGPASSWORDS`::
304304

305-
When installing X-Pack plugin with a `Trial` license and X-Pack Security enabled, whether the
305+
When installing {xpack} plugin with a `Trial` license and {security} enabled, whether the
306306
installation should skip setting up the built-in users `elastic`, `kibana` and `logstash_system`.
307307
Defaults to `false`
308308

309309
`ELASTICUSERPASSWORD`::
310310

311-
When installing X-Pack plugin with a `Trial` license and X-Pack Security enabled, the password
311+
When installing {xpack} plugin with a `Trial` license and {security} enabled, the password
312312
to use for the built-in user `elastic`. Defaults to `""`
313313

314314
`KIBANAUSERPASSWORD`::
315315

316-
When installing X-Pack plugin with a `Trial` license and X-Pack Security enabled, the password
316+
When installing {xpack} plugin with a `Trial` license and {security} enabled, the password
317317
to use for the built-in user `kibana`. Defaults to `""`
318318

319319
`LOGSTASHSYSTEMUSERPASSWORD`::
320320

321-
When installing X-Pack plugin with a `Trial` license and X-Pack Security enabled, the password
321+
When installing {xpack} plugin with a `Trial` license and {security} enabled, the password
322322
to use for the built-in user `logstash_system`. Defaults to `""`
323323

324324
To pass a value, simply append the property name and value using the format `<PROPERTYNAME>="<VALUE>"` to
325-
the installation command. For example, to use a different installation directory to the default one and to install https://www.elastic.co/products/x-pack[X-Pack]:
325+
the installation command. For example, to use a different installation directory to the default one and to install https://www.elastic.co/products/x-pack[{xpack}]:
326326

327327
["source","sh",subs="attributes,callouts"]
328328
--------------------------------------------

modules/lang-painless/src/test/resources/rest-api-spec/test/painless/70_mov_fn_agg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
setup:
44
- skip:
5-
version: " - 6.4.0"
5+
version: " - 6.3.99"
66
reason: "moving_fn added in 6.4.0"
77
- do:
88
indices.create:

rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/10_basic.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
"Shrink index via API":
33
- skip:
4-
version: " - 6.3.99"
5-
reason: expects warnings that pre-6.4.0 will not send
4+
version: " - 6.9.99"
5+
reason: expects warnings that pre-7.0.0 will not send
66
features: "warnings"
77
# creates an index with one document solely allocated on the master node
88
# and shrinks it into a new index with a single shard
@@ -67,8 +67,6 @@
6767
body:
6868
settings:
6969
index.number_of_replicas: 0
70-
warnings:
71-
- "resize operations without copying settings is deprecated; set parameter [copy_settings] to [true] for future default behavior"
7270

7371
- do:
7472
cluster.health:

rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
"Shrink index ignores target template mapping":
33
- skip:
4-
version: " - 6.3.99"
5-
reason: expects warnings that pre-6.4.0 will not send
4+
version: " - 6.9.99"
5+
reason: expects warnings that pre-7.0.0 will not send
66
features: "warnings"
77

88
- do:
@@ -71,8 +71,6 @@
7171
body:
7272
settings:
7373
index.number_of_replicas: 0
74-
warnings:
75-
- "resize operations without copying settings is deprecated; set parameter [copy_settings] to [true] for future default behavior"
7674

7775
- do:
7876
cluster.health:

rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
"Copy settings during shrink index":
33
- skip:
4-
version: " - 6.3.99"
5-
reason: expects warnings that pre-6.4.0 will not send
4+
version: " - 6.9.99"
5+
reason: expects warnings that pre-7.0.0 will not send
66
features: "warnings"
77

88
- do:
@@ -48,6 +48,8 @@
4848
settings:
4949
index.number_of_replicas: 0
5050
index.merge.scheduler.max_thread_count: 2
51+
warnings:
52+
- "parameter [copy_settings] is deprecated and will be removed in 8.0.0"
5153

5254
- do:
5355
cluster.health:
@@ -63,33 +65,31 @@
6365
- match: { copy-settings-target.settings.index.blocks.write: "true" }
6466
- match: { copy-settings-target.settings.index.routing.allocation.include._id: $master }
6567

66-
# now we do a actual shrink and do not copy settings (by default)
68+
# now we do a actual shrink and copy settings (by default)
6769
- do:
6870
indices.shrink:
6971
index: "source"
70-
target: "no-copy-settings-target"
72+
target: "default-copy-settings-target"
7173
wait_for_active_shards: 1
7274
master_timeout: 10s
7375
body:
7476
settings:
7577
index.number_of_replicas: 0
7678
index.merge.scheduler.max_thread_count: 2
77-
warnings:
78-
- "resize operations without copying settings is deprecated; set parameter [copy_settings] to [true] for future default behavior"
7979

8080
- do:
8181
cluster.health:
8282
wait_for_status: green
8383

8484
- do:
8585
indices.get_settings:
86-
index: "no-copy-settings-target"
86+
index: "default-copy-settings-target"
8787

88-
# only the request setting should be copied
89-
- is_false: no-copy-settings-target.settings.index.merge.scheduler.max_merge_count
90-
- match: { no-copy-settings-target.settings.index.merge.scheduler.max_thread_count: "2" }
91-
- is_false: no-copy-settings-target.settings.index.blocks.write
92-
- is_false: no-copy-settings-target.settings.index.routing.allocation.include._id
88+
# settings should be copied
89+
- match: { default-copy-settings-target.settings.index.merge.scheduler.max_merge_count: "4" }
90+
- match: { default-copy-settings-target.settings.index.merge.scheduler.max_thread_count: "2" }
91+
- match: { default-copy-settings-target.settings.index.blocks.write: "true" }
92+
- match: { default-copy-settings-target.settings.index.routing.allocation.include._id: $master }
9393

9494
# now we do a actual shrink and try to set no copy settings
9595
- do:

0 commit comments

Comments
 (0)