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
Throw IndexShardClosedException if shard is closed #8648
Conversation
@@ -89,7 +89,16 @@ | |||
private final MappingUpdatedAction mappingUpdatedAction; | |||
|
|||
private final RecoveryResponse response; | |||
private final CancelableThreads cancelableThreads = new CancelableThreads(); | |||
private final CancelableThreads cancelableThreads = new CancelableThreads() { | |||
@Override |
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.
Why not add this directly to the CancelableThreads class since there are no other uses of it? That way we can keep it as a final class and don't need to create an anonymous class here.
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.
I wanted to factor this out into a utils class and use it on the other side of the recovery too
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.
Makes sense, though even on the other side wouldn't you want to check if the index were closed and if so throw the appropriate response?
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.
there are several things we want to interrupt in the future safely so I keep it generic?
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.
Sounds good.
Left one comment otherwise LGTM |
@dakrone replied to your comment |
Today we throw a generic ElasticsearchException when a recovery is cancled. This causes verbose logging and send shard failures and additional unnecessary cluster state events. We can just throw IndexShardClosedException which prevents the send shard failures
900e37d
to
85a3971
Compare
Today we throw a generic ElasticsearchException when a recovery is cancled. This
causes verbose logging and send shard failures and additional unnecessary cluster state
events. We can just throw IndexShardClosedException which prevents the send shard failures.
we see lots of these exception in the logs which are misleading - this was introduced lately and never released: