-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Conversation
@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 |
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.
and -> an
I left mostly cosmetic comments, I know I'm not @bleskes but this LGTM :) |
Also, I think this is much cleaner than the previous code, so thanks @s1monw! |
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:
|
b16a1e0
to
a1731fe
Compare
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
a1731fe
to
3b5ed08
Compare
Refactor StoreRecoveryService to be a simple package private util class
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
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.