-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Remove the _default_
mapping.
#28248
Remove the _default_
mapping.
#28248
Conversation
8171a26
to
f6989ba
Compare
With only one type, the default mapping has become useless. The approach in this commit is to reject mapping updates that try to update the `_default` type regardless of the index creation version, and to ignore `_default_` mappings when recovering indices from a 6.x index. In the corner case that an empty 6.x index needs to be upgraded and this index only has a `_default_` mapping, then the `_default_` mapping will be renamed to `_doc`, which is the hardcoded mapping name in 7.0.
dfe8ec0
to
35ce44c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
// new types all at once , which can create a false error. | ||
|
||
// For example in MapperService we can't distinguish between a create index api call | ||
// and a put mapping api call, so we don't which type did exist before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/we don't/we don't know/
I find the approach chosen here to patch the cluster state problematic, as it leads to inconsistent views across 6.x / 7.x nodes. My suggestion is therefore to not fully remove default in 7.x just yet:
|
This will reject mapping updates to the `_default_` mapping with 7.x indices and still emit a deprecation warning with 6.x indices. Relates elastic#15613 Supersedes elastic#28248
With only one type, the default mapping has become useless. The approach in
this commit is to reject mapping updates that try to update the
_default
type regardless of the index creation version, and to ignore
_default_
mappings when recovering indices from a 6.x index. In the corner case that
an empty 6.x index needs to be upgraded and this index only has a
_default_
mapping, then the_default_
mapping will be renamed to_doc
,which is the hardcoded mapping name in 7.0.
I need reviews especially on the cluster-state processing side of the PR to know
whether the approach I took in order to dynamically remove default mappings
when processing mappings is ok.