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

Remove isRecovering method from Engine #47039

Merged
merged 1 commit into from
Sep 25, 2019

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Sep 24, 2019

We already prevent flushing in Engine if it's recovering. Hence we can remove the protection in IndexShard.

@dnhatn dnhatn added >enhancement :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. v8.0.0 v7.5.0 labels Sep 24, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

Copy link
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

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

We used to throw IllegalIndexShardStateException and now throw IllegalStateException. The former has a certain semantics, among others TransportActions.isShardNotAvailableException returns true for it. This seems to affect error handling in replication actions, including TransportFlushAction. Looks like we simply ignore recovering shards rather than fail on them (which makes sense now that we flush after recovery).

Also, looking at the original PR introducing this:
#20597 (comment)
both checks were added in the same commit and this was discussed at the time.

On the other hand no tests fail, which could indicate the change is OK (or we lack tests). And if there really is no difference, the check should be removed. I am only a bit hesitant given above and seek additional input on this.

@dnhatn
Copy link
Member Author

dnhatn commented Sep 24, 2019

@henningandersen Thank you for reviewing.

I also looked at that PR. We introduced this method as a workaround (#20597 (comment)) for IndexingMemoryController, but it is not required now.

Moreover, with #28049 we stop sending replication requests to recovering shards.

Perhaps it's safer to make this change in 8.0 only.

Copy link
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

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

Thanks @dnhatn for elaborating, I can no longer see any reason why we cannot remove this.

So LGTM, but I think we need an additional reviewer (@ywelsch ) on this.

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for providing the necessary context, made it much easier to review.

It's ok for this to go into 7.5

@dnhatn
Copy link
Member Author

dnhatn commented Sep 25, 2019

Thanks @henningandersen + @ywelsch.

@dnhatn dnhatn merged commit 9df6cbe into elastic:master Sep 25, 2019
@dnhatn dnhatn deleted the remove-is-recovering branch September 25, 2019 12:28
dnhatn added a commit that referenced this pull request Sep 25, 2019
We already prevent flushing in Engine if it's recovering. Hence, we can
remove the protection in IndexShard.
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.5.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants