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

Refactor StoreRecoveryService to be a simple package private util class #13766

Merged
merged 1 commit into from
Sep 29, 2015

Conversation

s1monw
Copy link
Contributor

@s1monw s1monw commented Sep 24, 2015

StoreRecoveryService used to be a pretty heavy class with lots of dependencies.
This class was basically not testable in isolation and had an async API with a listener.
This commit refactors this class to be a simple utility classs with a sync API hidden behind
the IndexShard interface. It includes single node tests and moves all the async properities to
the caller side.
Note, this change also removes the mapping update on master from the store recovery code since
it's not needed anymore in 3.0 because all stores have been subject to sync mapping updates such
that the master already has all the mappings for documents that made it into the transaction log.

@s1monw s1monw added >enhancement review :Distributed/Recovery Anything around constructing a new shard, either from a local or a remote source. v5.0.0-alpha1 labels Sep 24, 2015
@s1monw
Copy link
Contributor Author

s1monw commented Sep 24, 2015

@bleskes if you have time :)

import static org.elasticsearch.common.unit.TimeValue.timeValueMillis;

/**
* This package private utility class encapsulates the logic to recover an index shard from either and existing index on
Copy link
Member

Choose a reason for hiding this comment

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

and -> an

@dakrone
Copy link
Member

dakrone commented Sep 29, 2015

I left mostly cosmetic comments, I know I'm not @bleskes but this LGTM :)

@dakrone
Copy link
Member

dakrone commented Sep 29, 2015

Also, I think this is much cleaner than the previous code, so thanks @s1monw!

@bleskes
Copy link
Contributor

bleskes commented Sep 29, 2015

Looks good to me because @dakrone said so . I don't need to look ;)

On 29 sep. 2015 10:50 AM +0200, Lee Hinmannotifications@github.com, wrote:

Also, I think this is much cleaner than the previous code, so thanks@s1monw(https://github.com/s1monw)!


Reply to this email directly orview it on GitHub(#13766 (comment)).

@dakrone
Copy link
Member

dakrone commented Sep 29, 2015

LGTM

StoreRecoveryService used to be a pretty heavy class with lots of dependencies.
This class was basically not testable in isolation and had an async API with a listener.
This commit refactors this class to be a simple utility classs with a sync API hidden behind
the IndexShard interface. It includes single node tests and moves all the async properities to
the caller side.
Note, this change also removes the mapping update on master from the store recovery code since
it's not needed anymore in 3.0 because all stores have been subject to sync mapping updates such
that the master already has all the mappings for documents that made it into the transaction log.

Closes elastic#13766
s1monw added a commit that referenced this pull request Sep 29, 2015
Refactor StoreRecoveryService to be a simple package private util class
@s1monw s1monw merged commit 6bb7b9b into elastic:master Sep 29, 2015
@s1monw s1monw deleted the store_recovery_helper branch September 29, 2015 13:59
bleskes added a commit to bleskes/elasticsearch that referenced this pull request Oct 25, 2015
elastic#13766 removed the previous async trigger of shard recovery with the goal of making it easier to test. The async constructs were folded into IndicesClusterStateService. The change is good but it also made the state managment on the shard level async, while it was previously done on the cluster state thread, before triggering the recoveries (but it was hard to see that). This caused state related race conditions and some build failures (elastic#14115). To fix, the shard state management is now pulled out of the recovery code and made explicit in IndicesClusterStateService, and runs on the cluster state update thread.

 Closes elastic#14115
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Recovery Anything around constructing a new shard, either from a local or a remote source. >enhancement v5.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants