Skip to content

Always fail engine if delete operation fails #40117

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

Merged
merged 7 commits into from
Mar 19, 2019

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Mar 15, 2019

Unlike index operations which can fail at the document level to analyzing errors, delete operations should never fail at the document level whether soft-deletes is enabled or not. With this change, we will always fail the engine if we fail to apply a delete operation to Lucene.

Closes #33256

@dnhatn dnhatn added >enhancement :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. v8.0.0 v7.2.0 labels Mar 15, 2019
@dnhatn dnhatn requested review from s1monw and ywelsch March 15, 2019 19:51
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@dnhatn
Copy link
Member Author

dnhatn commented Mar 16, 2019

test this please

Copy link
Contributor

@s1monw s1monw left a comment

Choose a reason for hiding this comment

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

left one comment

} else {
throw ex;
}
assert indexWriter.getTragicException() != null : "delete operation should never fail at document level";
Copy link
Contributor

Choose a reason for hiding this comment

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

can we do this like this:

if (indexWriter.getTragicException() == null) {
  throw new AssertionError("delete operation should never fail at document level", ex);
}

we otherwise loose the original exception and then we are in trouble :)

@dnhatn
Copy link
Member Author

dnhatn commented Mar 19, 2019

Thanks @s1monw!

@dnhatn dnhatn merged commit a520cc5 into elastic:master Mar 19, 2019
@dnhatn dnhatn deleted the delete-failure branch March 19, 2019 13:13
dnhatn added a commit that referenced this pull request Mar 19, 2019
Unlike index operations which can fail at the document level to
analyzing errors, delete operations should never fail at the document
level whether soft-deletes is enabled or not. With this change, we will
always fail the engine if we fail to apply a delete operation to Lucene.

Closes #33256
kovrus added a commit to crate/crate that referenced this pull request Sep 2, 2019
Backport of elastic/elasticsearch#40117

With this change, we will always fail the engine
if we fail to apply a delete operation to Lucene.
kovrus added a commit to crate/crate that referenced this pull request Sep 3, 2019
Backport of elastic/elasticsearch#40117

With this change, we will always fail the engine
if we fail to apply a delete operation to Lucene.
kovrus added a commit to crate/crate that referenced this pull request Sep 3, 2019
Backport of elastic/elasticsearch#40117

With this change, we will always fail the engine
if we fail to apply a delete operation to Lucene.
kovrus added a commit to crate/crate that referenced this pull request Sep 3, 2019
Backport of elastic/elasticsearch#40117

With this change, we will always fail the engine
if we fail to apply a delete operation to Lucene.
mergify bot pushed a commit to crate/crate that referenced this pull request Sep 3, 2019
Backport of elastic/elasticsearch#40117

With this change, we will always fail the engine
if we fail to apply a delete operation to Lucene.
@jakelandis jakelandis removed the v8.0.0 label Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. >enhancement v7.2.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should we fail engine immediately after a delete fails?
4 participants