-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Avoid Needless Cache Status Fetches in SearchableSnapshotAllocator #66433
Avoid Needless Cache Status Fetches in SearchableSnapshotAllocator #66433
Conversation
We shouldn't fetch cache status if no allocation is possible to begin with. Also, this surfaced an issue with using the `Client` to `reroute` since that won't retry stale shards (failed the invalid license IT for example) so I moved to using the `RerouteService` like we do in the `GatewayAllocator`. (Plus, dried up one method that was 100% the same as in the replica allocator)
Pinging @elastic/es-distributed (Team:Distributed) |
1 similar comment
Pinging @elastic/es-distributed (Team:Distributed) |
@@ -44,7 +44,7 @@ | |||
explanations = RoutingExplanations.readFrom(in); | |||
} | |||
|
|||
public ClusterRerouteResponse(boolean acknowledged, ClusterState state, RoutingExplanations explanations) { | |||
ClusterRerouteResponse(boolean acknowledged, ClusterState state, RoutingExplanations explanations) { |
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.
Just a revert of making this public yesterday now that it's not needed for tests any longer.
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.
LGTM, though it would be good to add a test to verify the problem.
// pre-check if it can be allocated to any node that currently exists, so we won't list the cache sizes for it for nothing | ||
// TODO: in the following logic, we do not account for existing cache size when handling disk space checks, should and can we | ||
// reliably do this in a world of concurrent cache evictions or are we ok with the cache size just being a best effort hint | ||
// here? | ||
Tuple<Decision, Map<String, NodeAllocationResult>> result = canBeAllocatedToAtLeastOneNode(shardRouting, allocation); | ||
Tuple<Decision, Map<String, NodeAllocationResult>> result = ReplicaShardAllocator.canBeAllocatedToAtLeastOneNode( |
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.
Can we add a test that we do not trigger any reads or reroutes when deciders say no?
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.
Sure thing, I pushed 0cb0017 :)
Thanks Henning! |
…lastic#66433) We shouldn't fetch cache status if no allocation is possible to begin with. Also, this surfaced an issue with using the `Client` to `reroute` since that won't retry stale shards (failed the invalid license IT for example) so I moved to using the `RerouteService` like we do in the `GatewayAllocator`. (Plus, dried up one method that was 100% the same as in the replica allocator)
…66433) (#66444) We shouldn't fetch cache status if no allocation is possible to begin with. Also, this surfaced an issue with using the `Client` to `reroute` since that won't retry stale shards (failed the invalid license IT for example) so I moved to using the `RerouteService` like we do in the `GatewayAllocator`. (Plus, dried up one method that was 100% the same as in the replica allocator)
We shouldn't fetch cache status if no allocation is possible to begin with.
Also, this surfaced an issue with using the
Client
toreroute
since thatwon't retry stale shards (failed the invalid license IT for example) so I moved
to using the
RerouteService
like we do in theGatewayAllocator
.(Plus, dried up one method that was 100% the same as in the replica allocator)