Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make mapping.single_type only settable if the index is a 5.x index #24961

Closed
6 tasks done
s1monw opened this issue May 30, 2017 · 5 comments
Closed
6 tasks done

Make mapping.single_type only settable if the index is a 5.x index #24961

s1monw opened this issue May 30, 2017 · 5 comments

Comments

@s1monw
Copy link
Contributor

s1monw commented May 30, 2017

mapping.single_type allows to add multiple types which is something that 6.x indices must not allow. Yet, today this setting is still modifiable while it defaults to true In order to move make it only settable on 5.x indices and read-only in 6.0 we need to fix several things like:

@nik9000
Copy link
Member

nik9000 commented May 30, 2017

Move Rest tests that use multiple types into a mixed cluster scenario such that indices that are tested against are created with a 5.x version.

The qa:full-cluster-restart project might be useful here.

@s1monw
Copy link
Contributor Author

s1monw commented May 30, 2017

The qa:full-cluster-restart project might be useful here.

I don't think it needs to be that complicated we can just use the qa:mixed-cluster project

s1monw added a commit to s1monw/elasticsearch that referenced this issue May 30, 2017
This change skips rest tests that use mutlitple types if the cluster
is a pure 6.x cluster. This allows all indics to be created with a version
less than 6.0 and that means we can safely use the `mapping.single_type` setting.

Relates to elastic#24961
s1monw added a commit that referenced this issue Jun 7, 2017
This change skips rest tests that use mutlitple types if the cluster
is a pure 6.x cluster. This allows all indics to be created with a version
less than 6.0 and that means we can safely use the `mapping.single_type` setting.

Relates to #24961
s1monw added a commit to s1monw/elasticsearch that referenced this issue Jun 21, 2017
This change cleans up core tests to not use `index.mapping.single_type=false`
but instead where applicable use a single type or markt the index as created
with a pre 6.x version.

Relates to elastic#24961
s1monw added a commit that referenced this issue Jun 22, 2017
This change cleans up core tests to not use `index.mapping.single_type=false`
but instead where applicable use a single type or markt the index as created
with a pre 6.x version.

Relates to #24961
nik9000 added a commit to nik9000/elasticsearch that referenced this issue Jun 22, 2017
* Remove the setting from the yml tests and replace with tests using
`join` field. We can't use the setting in yml tests without lots of
backflips but we have `ReindexParentChildTests` for the coverage.
There weren't tests for `join` field with reindex before this. Adding
these tests discovered elastic#25363.
* Remove the setting from `ReindexParentChildTests` and replace with
`index.version.created=V_5_6_0`. This test can be entirely removed
when legacy parent/child support is dropped from core.

Relates to elastic#24961
s1monw added a commit to s1monw/elasticsearch that referenced this issue Jun 22, 2017
This change cleans up remaining tests  to not use index.mapping.single_type=false
but instead where applicable use a single type or markt the index as created
with a pre 6.x version.

Yet, there is still on leftover in the client tests that needs special attention.
See `org.elasticsearch.client.SearchIT`

Relates to elastic#24961
s1monw added a commit that referenced this issue Jun 23, 2017
This change cleans up remaining tests  to not use index.mapping.single_type=false
but instead where applicable use a single type or markt the index as created
with a pre 6.x version.

Yet, there is still on leftover in the client tests that needs special attention.
See `org.elasticsearch.client.SearchIT`

Relates to #24961
s1monw added a commit to s1monw/elasticsearch that referenced this issue Jun 23, 2017
In 6.x we prevent multiple types and default to `index.mapping.single_type: false`
This change removes the registered setting and ensures that it's preserved for
5.x indices.

Relates to elastic#24961
nik9000 added a commit that referenced this issue Jun 23, 2017
* Remove the setting from the yml tests and replace with tests using
`join` field. We can't use the setting in yml tests without lots of
backflips but we have `ReindexParentChildTests` for the coverage.
There weren't tests for `join` field with reindex before this. Adding
these tests discovered #25363.
* Remove the setting from `ReindexParentChildTests` and replace with
`index.version.created=V_5_6_0`. This test can be entirely removed
when legacy parent/child support is dropped from core.
* Port the yml tests that set _parent into integ tests so they
can set the index created version. These tests can be removed
when we drop support for _parent in core.
* Port a delete-by-query test for filtering based on type to an
`ESIntegTestCase` so it can use `index.version.created=5.6.0` to
setup documents of multiple types. This whole feature can be dropped
when we no longer support multiple types per index.

Relates to #24961
s1monw added a commit to s1monw/elasticsearch that referenced this issue Jun 25, 2017
This removes the remaining usage of `mapping.single_type` from the parent join
module and moves it's bwc test to the mixed cluster tests

Relates to elastic#24961
s1monw added a commit that referenced this issue Jun 26, 2017
This removes the remaining usage of `mapping.single_type` from the parent join
module and moves it's bwc test to the mixed cluster tests

Relates to #24961
Relates to #20257
s1monw added a commit that referenced this issue Jul 5, 2017
…5375)

In 6.x we prevent multiple types and default to `index.mapping.single_type: false`
This change removes the registered setting and ensures that it's preserved for
5.x indices.

Relates to #24961
@s1monw
Copy link
Contributor Author

s1monw commented Jul 5, 2017

All tasks done. Thanks everyone

@dcorking
Copy link

dcorking commented May 4, 2018

The Upgrade Assistant in X-Pack doesn't seem to be able to handle this.

Index name: .kibana
Required action: reindex
Failed to create index.

{
  "statusCode": 500,
  "error": "Internal Server Error",
  "message": "An internal server error occurred",
  "code": "ERR_CREATE_INDEX_FAILED",
  "root_cause": [
    {
      "type": "illegal_argument_exception",
      "reason": "unknown setting [index.mapping.single_type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
    }
  ],
  "type": "illegal_argument_exception",
  "reason": "unknown setting [index.mapping.single_type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings",
  "reindexedIndexName": ".kibana-6"
}

The breaking changes documentation mentions the removed setting

In 6.x, there is no need to specify index.mapping.single_type as that is the default.

But it doesn't mention how to use the Upgrade Assistant to deal with it.

A web search led me here. But where is the right place to report this error?

@dcorking
Copy link

dcorking commented May 4, 2018

Good news. Although I was disappointed that the recommended upgrade path of the Upgrade Assistant's Reindex Helper didn't work (with the error reported above), I was able to successfully upgrade the internal index for Kibana from 5.6 to 6.2 following the manual instructions at https://www.elastic.co/guide/en/kibana/6.2/migrating-6.0-index.html

It only took a few seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants