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

[ML] Delete annotation method assumes annotation is in current write index #113365

Closed
droberts195 opened this issue Sep 29, 2021 · 0 comments · Fixed by #115328
Closed

[ML] Delete annotation method assumes annotation is in current write index #113365

droberts195 opened this issue Sep 29, 2021 · 0 comments · Fixed by #115328
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Anomaly Detection ML anomaly detection :ml v7.16.0

Comments

@droberts195
Copy link
Contributor

The deleteAnnotation function in ML assumes that the annotation to be deleted is in the index that the annotations write alias currently points to:

async function deleteAnnotation(id: string) {
const params: DeleteParams = {
index: ML_ANNOTATIONS_INDEX_ALIAS_WRITE,
id,
refresh: 'wait_for',
};
const { body } = await asInternalUser.delete(params);
return body;
}

This assumption is incorrect. The annotation to be deleted could be in any one of the indices that the annotations read alias points to.

There are two possible ways to fix this:

  1. When reading annotations into memory, each annotation object remembers which index it was stored it. Then, if it is deleted, that index is passed to the delete function.
  2. The delete function does a delete-by-query on the read alias using an IDs search with the ID of the annotation to be deleted. This will generally find 1 document in one of the indices that the read alias points to, and 0 documents in all the others.

I'll leave it up to the UI team to decide which is easiest to implement.

This needs to be fixed for 7.16, because then in 8.0 we'll have the chance to actually have multiple annotations indices behind the aliases. (We have got away with this bug up to now because there's only been one index that both the read and write aliases point at. But the whole point of having separate read and write aliases was to give the flexibility to have multiple backing indices.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Anomaly Detection ML anomaly detection :ml v7.16.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants