Skip to content

Commit

Permalink
Merge remote-tracking branch 'elastic/master' into retention-lease-ccr
Browse files Browse the repository at this point in the history
* elastic/master:
  Only flush Watcher's bulk processor if Watcher is enabled (elastic#38803)
  Update the removal of types docs with the new 6.7 behavior. (elastic#38869)
  • Loading branch information
jasontedor committed Feb 14, 2019
2 parents ae9cff2 + 70e5a72 commit d027302
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
24 changes: 15 additions & 9 deletions docs/reference/mapping/removal_of_types.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,10 @@ Elasticsearch 6.x::

* In 6.7, the index creation, index template, and mapping APIs support a query
string parameter (`include_type_name`) which indicates whether requests and
responses should include a type name. It defaults to `true`, and not setting
`include_type_name=false` will result in a deprecation warning. Indices which
don't have an explicit type will use the dummy type name `_doc`.
responses should include a type name. It defaults to `true`, and should be set
to an explicit value to prepare to upgrade to 7.0. Not setting `include_type_name`
will result in a deprecation warning. Indices which don't have an explicit type will
use the dummy type name `_doc`.

Elasticsearch 7.x::

Expand All @@ -271,8 +272,8 @@ Elasticsearch 7.x::
for auto-generated ids.

* The `include_type_name` parameter in the index creation, index template,
and mapping APIs will default to `false`. Setting the parameter will result
in a deprecation warning.
and mapping APIs will default to `false`. Setting the parameter at all will
result in a deprecation warning.

* The `_default_` mapping type is removed.

Expand Down Expand Up @@ -438,12 +439,16 @@ documents to it using typeless `index` calls, and load documents with typeless
==== Indices APIs

Index creation, index template, and mapping APIs support a new `include_type_name`
url parameter that specifies whether mapping definitions in requests and responses
URL parameter that specifies whether mapping definitions in requests and responses
should contain the type name. The parameter defaults to `true` in version 6.7 to
match the pre-7.0 behavior of using type names in mappings. It defaults to `false`
in version 7.0 and will be removed in version 8.0.

See some examples of interactions with Elasticsearch with this option provided:
It should be set explicitly in 6.7 to prepare to upgrade to 7.0. To avoid deprecation
warnings in 6.7, the parameter can be set to either `true` or `false`. In 7.0, setting
`include_type_name` at all will result in a deprecation warning.

See some examples of interactions with Elasticsearch with this option set to `false`:

[source,js]
--------------------------------------------------
Expand Down Expand Up @@ -631,8 +636,9 @@ GET index/_doc/1
[float]
==== Index templates

It is recommended to make index templates typeless before upgrading to 7.0 by
re-adding them with `include_type_name` set to `false`.
It is recommended to make index templates typeless by re-adding them with
`include_type_name` set to `false`. Under the hood, typeless templates will use
the dummy type `_doc` when creating indices.

In case typeless templates are used with typed index creation calls or typed
templates are used with typeless index creation calls, the template will still
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,12 @@ public List<ScriptContext<?>> getContexts() {

@Override
public void close() throws IOException {
bulkProcessor.flush();
if (enabled) {
bulkProcessor.flush();
}
IOUtils.closeWhileHandlingException(httpClient);
try {
if (bulkProcessor.awaitClose(10, TimeUnit.SECONDS) == false) {
if (enabled && bulkProcessor.awaitClose(10, TimeUnit.SECONDS) == false) {
logger.warn("failed to properly close watcher bulk processor");
}
} catch (InterruptedException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public void testWatcherDisabledTests() throws Exception {

// also no component creation if not enabled
assertThat(watcher.createComponents(null, null, null, null, null, null, null, null, null), hasSize(0));

watcher.close();
}

public void testThreadPoolSize() {
Expand Down

0 comments on commit d027302

Please sign in to comment.