Skip to content

Conversation

@droberts195
Copy link

Due to historical bugs a non-negligible proportion of
ML users have an annotations index with incorrect mappings.
We have published instructions on how to correct the
mappings, but the procedure is complicated, and some users
prefer to tolerate the lack of annotations functionality
rather than attempt the operations necessary to fix the
mappings of the existing index.

The best way to solve the problem is to create a new
annotations index with the correct mappings, and use this
for all annotations created from that moment on. This PR
implements that solution. The annotations read alias will
span the old and new indices in the case where both exist.
The annotations write index is adjusted to point only at
the new index.

Fixes #78439

Due to historical bugs a non-negligible proportion of
ML users have an annotations index with incorrect mappings.
We have published instructions on how to correct the
mappings, but the procedure is complicated, and some users
prefer to tolerate the lack of annotations functionality
rather than attempt the operations necessary to fix the
mappings of the existing index.

The best way to solve the problem is to create a new
annotations index with the correct mappings, and use this
for all annotations created from that moment on. This PR
implements that solution. The annotations read alias will
span the old and new indices in the case where both exist.
The annotations write index is adjusted to point only at
the new index.

Fixes elastic#78439
@droberts195
Copy link
Author

@elasticmachine update branch

@droberts195 droberts195 marked this pull request as ready for review October 14, 2021 11:20
@droberts195 droberts195 added the :ml Machine learning label Oct 14, 2021
@elasticmachine elasticmachine added the Team:ML Meta label for the ML team label Oct 14, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)


@Before
public void createComponents() throws Exception {
waitForMlTemplates();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use a template to create the annotations index, so this should not be needed.

Settings.builder()
.put(SETTING_NUMBER_OF_SHARDS, 1)
.put(SETTING_NUMBER_OF_REPLICAS, 0)
.put(SETTING_INDEX_HIDDEN, true)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just making the unit test code reflect production more accurately. It wasn't a bug end users would have seen. Same with the tweaks below.

Copy link
Contributor

@dimitris-athanasiou dimitris-athanasiou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@droberts195 droberts195 merged commit 0af4fe2 into elastic:master Oct 14, 2021
@droberts195 droberts195 deleted the new_annotations_index_template branch October 14, 2021 12:24
droberts195 pushed a commit that referenced this pull request Oct 14, 2021
droberts195 pushed a commit to droberts195/elasticsearch that referenced this pull request Oct 14, 2021
Due to historical bugs a non-negligible proportion of
ML users have an annotations index with incorrect mappings.
We have published instructions on how to correct the
mappings, but the procedure is complicated, and some users
prefer to tolerate the lack of annotations functionality
rather than attempt the operations necessary to fix the
mappings of the existing index.

The best way to solve the problem is to create a new
annotations index with the correct mappings, and use this
for all annotations created from that moment on. This PR
implements that solution. The annotations read alias will
span the old and new indices in the case where both exist.
The annotations write index is adjusted to point only at
the new index.

Adds back elastic#79006, which was reverted because Kibana was
not ready.
droberts195 pushed a commit that referenced this pull request Oct 19, 2021
Due to historical bugs a non-negligible proportion of
ML users have an annotations index with incorrect mappings.
We have published instructions on how to correct the
mappings, but the procedure is complicated, and some users
prefer to tolerate the lack of annotations functionality
rather than attempt the operations necessary to fix the
mappings of the existing index.

The best way to solve the problem is to create a new
annotations index with the correct mappings, and use this
for all annotations created from that moment on. This PR
implements that solution. The annotations read alias will
span the old and new indices in the case where both exist.
The annotations write index is adjusted to point only at
the new index.

Adds back #79006, which was reverted because Kibana was
not ready.
droberts195 pushed a commit to droberts195/elasticsearch that referenced this pull request Oct 19, 2021
Due to historical bugs a non-negligible proportion of
ML users have an annotations index with incorrect mappings.
We have published instructions on how to correct the
mappings, but the procedure is complicated, and some users
prefer to tolerate the lack of annotations functionality
rather than attempt the operations necessary to fix the
mappings of the existing index.

The best way to solve the problem is to create a new
annotations index with the correct mappings, and use this
for all annotations created from that moment on. This PR
implements that solution. The annotations read alias will
span the old and new indices in the case where both exist.
The annotations write index is adjusted to point only at
the new index.

Adds back elastic#79006, which was reverted because Kibana was
not ready.
droberts195 pushed a commit that referenced this pull request Oct 19, 2021
Due to historical bugs a non-negligible proportion of
ML users have an annotations index with incorrect mappings.
We have published instructions on how to correct the
mappings, but the procedure is complicated, and some users
prefer to tolerate the lack of annotations functionality
rather than attempt the operations necessary to fix the
mappings of the existing index.

The best way to solve the problem is to create a new
annotations index with the correct mappings, and use this
for all annotations created from that moment on. This PR
implements that solution. The annotations read alias will
span the old and new indices in the case where both exist.
The annotations write index is adjusted to point only at
the new index.

Adds back #79006, which was reverted because Kibana was
not ready.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :ml Machine learning Team:ML Meta label for the ML team v8.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ML] Switch to a new annotations index to bypass historical mappings issues

4 participants