Skip to content

Commit eb22ebb

Browse files
Merge remote-tracking branch 'elastic/master' into store-snapshot-version-in-index-N
2 parents 86ef75f + fa4869a commit eb22ebb

File tree

92 files changed

+2008
-928
lines changed

Some content is hidden

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

92 files changed

+2008
-928
lines changed

client/rest-high-level/src/main/java/org/elasticsearch/client/IndicesClient.java

+6
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,10 @@ public Cancellable flushAsync(FlushRequest flushRequest, RequestOptions options,
423423
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
424424
* @return the response
425425
* @throws IOException in case there is a problem sending the request or parsing back the response
426+
* @deprecated synced flush is deprecated and will be removed in 8.0.
427+
* Use {@link #flush(FlushRequest, RequestOptions)} instead.
426428
*/
429+
@Deprecated
427430
public SyncedFlushResponse flushSynced(SyncedFlushRequest syncedFlushRequest, RequestOptions options) throws IOException {
428431
return restHighLevelClient.performRequestAndParseEntity(syncedFlushRequest, IndicesRequestConverters::flushSynced, options,
429432
SyncedFlushResponse::fromXContent, emptySet());
@@ -437,7 +440,10 @@ public SyncedFlushResponse flushSynced(SyncedFlushRequest syncedFlushRequest, Re
437440
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
438441
* @param listener the listener to be notified upon request completion
439442
* @return cancellable that may be used to cancel the request
443+
* @deprecated synced flush is deprecated and will be removed in 8.0.
444+
* Use {@link #flushAsync(FlushRequest, RequestOptions, ActionListener)} instead.
440445
*/
446+
@Deprecated
441447
public Cancellable flushSyncedAsync(SyncedFlushRequest syncedFlushRequest, RequestOptions options,
442448
ActionListener<SyncedFlushResponse> listener) {
443449
return restHighLevelClient.performRequestAsyncAndParseEntity(syncedFlushRequest, IndicesRequestConverters::flushSynced, options,

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
import org.elasticsearch.index.IndexSettings;
9898
import org.elasticsearch.index.query.QueryBuilder;
9999
import org.elasticsearch.index.query.QueryBuilders;
100+
import org.elasticsearch.indices.flush.SyncedFlushService;
100101
import org.elasticsearch.rest.RestStatus;
101102

102103
import java.io.IOException;
@@ -768,7 +769,8 @@ public void testSyncedFlush() throws IOException {
768769
createIndex(index, settings);
769770
SyncedFlushRequest syncedFlushRequest = new SyncedFlushRequest(index);
770771
SyncedFlushResponse flushResponse =
771-
execute(syncedFlushRequest, highLevelClient().indices()::flushSynced, highLevelClient().indices()::flushSyncedAsync);
772+
execute(syncedFlushRequest, highLevelClient().indices()::flushSynced, highLevelClient().indices()::flushSyncedAsync,
773+
expectWarnings(SyncedFlushService.SYNCED_FLUSH_DEPRECATION_MESSAGE));
772774
assertThat(flushResponse.totalShards(), equalTo(1));
773775
assertThat(flushResponse.successfulShards(), equalTo(1));
774776
assertThat(flushResponse.failedShards(), equalTo(0));
@@ -783,7 +785,8 @@ public void testSyncedFlush() throws IOException {
783785
execute(
784786
syncedFlushRequest,
785787
highLevelClient().indices()::flushSynced,
786-
highLevelClient().indices()::flushSyncedAsync
788+
highLevelClient().indices()::flushSyncedAsync,
789+
expectWarnings(SyncedFlushService.SYNCED_FLUSH_DEPRECATION_MESSAGE)
787790
)
788791
);
789792
assertEquals(RestStatus.NOT_FOUND, exception.status());

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,8 @@ public void testApiNamingConventions() throws Exception {
839839
// looking like it doesn't have a valid implementatation when it does.
840840
apiUnsupported.remove("indices.get_template");
841841

842-
842+
// Synced flush is deprecated
843+
apiUnsupported.remove("indices.flush_synced");
843844

844845
for (Map.Entry<String, Set<Method>> entry : methods.entrySet()) {
845846
String apiName = entry.getKey();

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

+6-2
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,9 @@ public void testSyncedFlushIndex() throws Exception {
10181018
// end::flush-synced-request-indicesOptions
10191019

10201020
// tag::flush-synced-execute
1021-
SyncedFlushResponse flushSyncedResponse = client.indices().flushSynced(request, RequestOptions.DEFAULT);
1021+
SyncedFlushResponse flushSyncedResponse = client.indices().flushSynced(request, expectWarnings(
1022+
"Synced flush is deprecated and will be removed in 8.0. Use flush at _/flush or /{index}/_flush instead."
1023+
));
10221024
// end::flush-synced-execute
10231025

10241026
// tag::flush-synced-response
@@ -1062,7 +1064,9 @@ public void onFailure(Exception e) {
10621064
listener = new LatchedActionListener<>(listener, latch);
10631065

10641066
// tag::flush-synced-execute-async
1065-
client.indices().flushSyncedAsync(request, RequestOptions.DEFAULT, listener); // <1>
1067+
client.indices().flushSyncedAsync(request, expectWarnings(
1068+
"Synced flush is deprecated and will be removed in 8.0. Use flush at _/flush or /{index}/_flush instead."
1069+
), listener); // <1>
10661070
// end::flush-synced-execute-async
10671071

10681072
assertTrue(latch.await(30L, TimeUnit.SECONDS));

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,8 @@ public void testGetRoles() throws Exception {
694694

695695
List<Role> roles = response.getRoles();
696696
assertNotNull(response);
697-
// 28 system roles plus the three we created
698-
assertThat(roles.size(), equalTo(28 + 3));
697+
// 29 system roles plus the three we created
698+
assertThat(roles.size(), equalTo(29 + 3));
699699
}
700700

701701
{

docs/reference/ccr/requirements.asciidoc

-55
Original file line numberDiff line numberDiff line change
@@ -41,58 +41,3 @@ to a follower the following process will fail due to incomplete history on the l
4141
The default value is `12h`.
4242

4343
For more information about index settings, see {ref}/index-modules.html[Index modules].
44-
45-
46-
[[ccr-overview-beats]]
47-
==== Setting soft deletes on indices created by APM Server or Beats
48-
49-
If you want to replicate indices created by APM Server or Beats, and are
50-
allowing APM Server or Beats to manage index templates, you need to configure
51-
soft deletes on the underlying index templates. To configure soft deletes on the
52-
underlying index templates, incorporate the following changes to the relevant
53-
APM Server or Beats configuration file.
54-
55-
["source","yaml"]
56-
----------------------------------------------------------------------
57-
setup.template.overwrite: true
58-
setup.template.settings:
59-
index.soft_deletes.retention.operations: 1024
60-
----------------------------------------------------------------------
61-
62-
For additional information on controlling the index templates managed by APM
63-
Server or Beats, see the relevant documentation on loading the Elasticsearch
64-
index template.
65-
66-
67-
[[ccr-overview-logstash]]
68-
==== Setting soft deletes on indices created by Logstash
69-
70-
If you want to replicate indices created by Logstash, and are using Logstash to
71-
manage index templates, you need to configure soft deletes on a custom Logstash
72-
index template. To configure soft deletes on the underlying index template,
73-
incorporate the following change to a custom Logstash template.
74-
75-
["source","js"]
76-
----------------------------------------------------------------------
77-
{
78-
"settings" : {
79-
"index.soft_deletes.retention.operations" : 1024
80-
}
81-
}
82-
----------------------------------------------------------------------
83-
// NOTCONSOLE
84-
85-
Additionally, you will need to configure the Elasticsearch output plugin to use
86-
this custom template.
87-
88-
["source","ruby"]
89-
----------------------------------------------------------------------
90-
output {
91-
elasticsearch {
92-
template => "/path/to/custom/logstash/template.json"
93-
}
94-
}
95-
----------------------------------------------------------------------
96-
97-
For additional information on controlling the index templates managed by
98-
Logstash, see the relevant documentation on the Elasticsearch output plugin.

docs/reference/commands/index.asciidoc

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ tasks from the command line:
1010
* <<certgen>>
1111
* <<certutil>>
1212
* <<elasticsearch-croneval>>
13+
* <<elasticsearch-keystore>>
1314
* <<node-tool>>
1415
* <<saml-metadata>>
1516
* <<setup-passwords>>
@@ -22,6 +23,7 @@ tasks from the command line:
2223
include::certgen.asciidoc[]
2324
include::certutil.asciidoc[]
2425
include::croneval.asciidoc[]
26+
include::keystore.asciidoc[]
2527
include::node-tool.asciidoc[]
2628
include::saml-metadata.asciidoc[]
2729
include::setup-passwords.asciidoc[]
+149
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
[[elasticsearch-keystore]]
2+
== elasticsearch-keystore
3+
4+
The `elasticsearch-keystore` command manages <<secure-settings,secure settings>>
5+
in the {es} keystore.
6+
7+
[discrete]
8+
[[elasticsearch-keystore-synopsis]]
9+
=== Synopsis
10+
11+
[source,shell]
12+
--------------------------------------------------
13+
bin/elasticsearch-keystore
14+
([add <setting>] [--stdin] |
15+
[add-file <setting> <path>] | [create] |
16+
[list] | [remove <setting>] | [upgrade])
17+
[-h, --help] ([-s, --silent] | [-v, --verbose])
18+
--------------------------------------------------
19+
20+
[discrete]
21+
[[elasticsearch-keystore-description]]
22+
=== Description
23+
24+
IMPORTANT: This command should be run as the user that will run {es}.
25+
26+
Currently, all secure settings are node-specific settings that must have the
27+
same value on every node. Therefore you must run this command on every node.
28+
29+
Modifications to the keystore do not take effect until you restart {es}.
30+
31+
Only some settings are designed to be read from the keystore. However, there
32+
is no validation to block unsupported settings from the keystore and they can
33+
cause {es} to fail to start. To see whether a setting is supported in the
34+
keystore, see the setting reference.
35+
36+
[discrete]
37+
[[elasticsearch-keystore-parameters]]
38+
=== Parameters
39+
40+
`add <setting>`:: Adds settings to the keystore. By default, you are prompted
41+
for the value of the setting.
42+
43+
`add-file <setting> <path>`:: Adds a file to the keystore.
44+
45+
`create`:: Creates the keystore.
46+
47+
`-h, --help`:: Returns all of the command parameters.
48+
49+
`list`:: Lists the settings in the keystore.
50+
51+
`remove <setting>:: Removes a setting from the keystore.
52+
53+
`-s, --silent`:: Shows minimal output.
54+
55+
`--stdin`:: When used with the `add` parameter, you can pass the setting value
56+
through standard input (stdin). See <<add-string-to-keystore>>.
57+
58+
`upgrade`:: Upgrades the internal format of the keystore.
59+
60+
`-v, --verbose`:: Shows verbose output.
61+
62+
[discrete]
63+
[[elasticsearch-keystore-examples]]
64+
=== Examples
65+
66+
[discrete]
67+
[[creating-keystore]]
68+
==== Create the keystore
69+
70+
To create the `elasticsearch.keystore`, use the `create` command:
71+
72+
[source,sh]
73+
----------------------------------------------------------------
74+
bin/elasticsearch-keystore create
75+
----------------------------------------------------------------
76+
77+
A `elasticsearch.keystore` file is created alongside the `elasticsearch.yml`
78+
file.
79+
80+
[discrete]
81+
[[list-settings]]
82+
==== List settings in the keystore
83+
84+
To list the settings in the keystore, use the `list` command.
85+
86+
[source,sh]
87+
----------------------------------------------------------------
88+
bin/elasticsearch-keystore list
89+
----------------------------------------------------------------
90+
91+
[discrete]
92+
[[add-string-to-keystore]]
93+
==== Add settings to the keystore
94+
95+
Sensitive string settings, like authentication credentials for Cloud plugins,
96+
can be added with the `add` command:
97+
98+
[source,sh]
99+
----------------------------------------------------------------
100+
bin/elasticsearch-keystore add the.setting.name.to.set
101+
----------------------------------------------------------------
102+
103+
You are prompted to enter the value of the setting. To pass the value
104+
through standard input (stdin), use the `--stdin` flag:
105+
106+
[source,sh]
107+
----------------------------------------------------------------
108+
cat /file/containing/setting/value | bin/elasticsearch-keystore add --stdin the.setting.name.to.set
109+
----------------------------------------------------------------
110+
111+
[discrete]
112+
[[add-file-to-keystore]]
113+
==== Add files to the keystore
114+
115+
You can add sensitive files, like authentication key files for Cloud plugins,
116+
using the `add-file` command. Be sure to include your file path as an argument
117+
after the setting name.
118+
119+
[source,sh]
120+
----------------------------------------------------------------
121+
bin/elasticsearch-keystore add-file the.setting.name.to.set /path/example-file.json
122+
----------------------------------------------------------------
123+
124+
[discrete]
125+
[[remove-settings]]
126+
==== Remove settings from the keystore
127+
128+
To remove a setting from the keystore, use the `remove` command:
129+
130+
[source,sh]
131+
----------------------------------------------------------------
132+
bin/elasticsearch-keystore remove the.setting.name.to.remove
133+
----------------------------------------------------------------
134+
135+
[discrete]
136+
[[keystore-upgrade]]
137+
==== Upgrade the keystore
138+
139+
Occasionally, the internal format of the keystore changes. When {es} is
140+
installed from a package manager, an upgrade of the on-disk keystore to the new
141+
format is done during package upgrade. In other cases, {es} performs the upgrade
142+
during node startup. This requires that {es} has write permissions to the
143+
directory that contains the keystore. Alternatively, you can manually perform
144+
such an upgrade by using the `upgrade` command:
145+
146+
[source,sh]
147+
----------------------------------------------------------------
148+
bin/elasticsearch-keystore upgrade
149+
----------------------------------------------------------------

docs/reference/ilm/policy-definitions.asciidoc

+9-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ PUT _ilm/policy/my_policy
5555
}
5656
--------------------------------------------------
5757

58-
The Above example configures a policy that moves the index into the warm
58+
The above example configures a policy that moves the index into the warm
5959
phase after one day. Until then, the index is in a waiting state. After
6060
moving into the warm phase, it will wait until 30 days have elapsed before
6161
moving to the delete phase and deleting the index.
@@ -76,10 +76,14 @@ check occurs.
7676
=== Phase Execution
7777

7878
The current phase definition, of an index's policy being executed, is stored
79-
in the index's metadata. The phase and its actions are compiled into a series
80-
of discrete steps that are executed sequentially. Since some {ilm-init} actions
81-
are more complex and involve multiple operations against an index, each of these
82-
operations are done in isolation in a unit called a "step". The
79+
in the index's metadata. This phase definition is cached to prevent changes to
80+
the policy from putting the index in a state where it cannot proceed from its
81+
current step. When the policy is updated we check to see if this phase
82+
definition can be safely updated, and if so, update the cached definition in
83+
indices using the updated policy. The phase and its actions are compiled into a
84+
series of discrete steps that are executed sequentially. Since some {ilm-init}
85+
actions are more complex and involve multiple operations against an index, each
86+
of these operations are done in isolation in a unit called a "step". The
8387
<<ilm-explain-lifecycle,Explain Lifecycle API>> exposes this information to us
8488
to see which step our index is either to execute next, or is currently
8589
executing.

docs/reference/indices/synced-flush.asciidoc

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
<titleabbrev>Synced flush</titleabbrev>
55
++++
66

7+
deprecated::[7.6, synced-flush is deprecated and will be removed in 8.0.
8+
Use <<indices-flush,flush>> instead. A <<indices-flush,flush>> has the
9+
same effect as a synced flush on Elasticsearch 7.6 or later]
10+
711
Performs a synced flush on one or more indices.
812

913
[source,console]

docs/reference/monitoring/configuring-filebeat.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ If {security-features} are enabled, you must provide a valid user ID and
117117
password so that {filebeat} can connect to {kib}:
118118

119119
.. Create a user on the monitoring cluster that has the
120-
<<built-in-roles,`kibana_user` built-in role>> or equivalent
120+
<<built-in-roles,`kibana_admin` built-in role>> or equivalent
121121
privileges.
122122

123123
.. Add the `username` and `password` settings to the {es} output information in

docs/reference/rest-api/common-parms.asciidoc

+3-2
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,9 @@ end::source-transforms[]
764764

765765
tag::source-index-transforms[]
766766
The _source indices_ for the {transform}. It can be a single index, an index
767-
pattern (for example, `"myindex*"`), or an array of indices (for example,
768-
`["index1", "index2"]`).
767+
pattern (for example, `"myindex*"`), an array of indices (for example,
768+
`["index1", "index2"]`), or an array of index patterns (for example,
769+
`["myindex1-*", "myindex2-*"]`.
769770
end::source-index-transforms[]
770771

771772
tag::source-query-transforms[]

0 commit comments

Comments
 (0)