-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
HotToWarmTieringService changes to tier shards #14891
base: main
Are you sure you want to change the base?
HotToWarmTieringService changes to tier shards #14891
Conversation
❌ Gradle check result for 2e9f80d: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
2e9f80d
to
052d551
Compare
❌ Gradle check result for 052d551: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
052d551
to
0813dac
Compare
❌ Gradle check result for 0813dac: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
server/src/main/java/org/opensearch/cluster/routing/RoutingPool.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/opensearch/cluster/routing/allocation/allocator/RemoteShardsBalancer.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/indices/tiering/HotToWarmTieringService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/indices/tiering/HotToWarmTieringService.java
Outdated
Show resolved
Hide resolved
❌ Gradle check result for 41f986c: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
41f986c
to
8975e97
Compare
d7bffe7
to
4774394
Compare
❌ Gradle check result for 4774394: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
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.
Needs a changelog entry but otherwise LGTM
...c/main/java/org/opensearch/action/admin/indices/tiering/TransportHotToWarmTieringAction.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/opensearch/action/admin/indices/tiering/TransportHotToWarmTieringAction.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/indices/tiering/HotToWarmTieringService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/indices/tiering/HotToWarmTieringService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/indices/tiering/TieringRequestValidator.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/indices/tiering/HotToWarmTieringService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/indices/tiering/HotToWarmTieringService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/indices/tiering/HotToWarmTieringService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/action/admin/indices/tiering/TieringRequestContext.java
Outdated
Show resolved
Hide resolved
@ExperimentalApi | ||
public class TieringRequestContext { | ||
private final ActionListener<HotToWarmTieringResponse> actionListener; | ||
private final Map<Index, IndexTieringInfo> indexTieringStatusMap; |
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.
how about just keeping 2 set for accepted
and completed
indices and 1 map for failedIndices
. That way you can keep the indices in respective data structures and don't have to do filtering every time for indices in specific state.
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 thought about the above as well. However, the current approach is cleaner in that the entries need not be moved from accepted set to completed/failed indices, the entry is only in one of the states of tiering (keeping only one source of truth).
Also, later if we plan to extend the tiering states, TieringRequestContext can be easily extensible for different states of tiering. In any case if there is another transition state introduced for another type of tiering, we would need to introduce another set whereas in current way, we just need to add a state to IndexTieringState
.
I would like to keep it as is unless you have a strong opinion 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.
However, the current approach is cleaner in that the entries need not be moved from accepted set to completed/failed indices, the entry is only in one of the states of tiering (keeping only one source of truth)
I don't see issue with moving from one set to another. Each data structure is providing an easy way to get the indices in that state which is what most of the calls from H2WTieringService is and hence the suggestion. We still have single source of truth which is TieringRequestContext
object that encapsulates these different data structures to maintain indices in different states instead of a single map.
Also, later if we plan to extend the tiering states, TieringRequestContext can be easily extensible for different states of tiering. In any case if there is another transition state introduced for another type of tiering, we would need to introduce another set whereas in current way, we just need to add a state to IndexTieringState
Agree on this but don't see any other tiering state at the moment. Also TieringRequestContext
is tied to HotToWarmMigration
so if we have to reuse or introduce any new state for a different tiering type, then refactoring will be needed anyways. We can always think about the better mechanism when the use case with other tiering types are known.
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.
However, the current approach is cleaner in that the entries need not be moved from accepted set to completed/failed indices, the entry is only in one of the states of tiering (keeping only one source of truth)
I don't see issue with moving from one set to another. Each data structure is providing an easy way to get the indices in that state which is what most of the calls from H2WTieringService is and hence the suggestion. We still have single source of truth which is
TieringRequestContext
object that encapsulates these different data structures to maintain indices in different states instead of a single map.
I agree that for a given request we have a single source of truth which is TieringRequestContext
. However, to figure out the state of the index (accepted/completed/failed), we would have different sources of truth.
Given that we would have a limited number of indices that would undergo tiering at a given time, I see that the filtering operation would be a constant time operation. What is the other concern that you see with the current implementation?
Also with sets approach - we would need 3 sets and one map here - accepted, successful, completed, failed as compared to what is maintained as a single map in the current implementation.
Also, later if we plan to extend the tiering states, TieringRequestContext can be easily extensible for different states of tiering. In any case if there is another transition state introduced for another type of tiering, we would need to introduce another set whereas in current way, we just need to add a state to IndexTieringState
Agree on this but don't see any other tiering state at the moment. Also
TieringRequestContext
is tied toHotToWarmMigration
so if we have to reuse or introduce any new state for a different tiering type, then refactoring will be needed anyways. We can always think about the better mechanism when the use case with other tiering types are known.
makes sense.
4774394
to
7da1aa6
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14891 +/- ##
============================================
+ Coverage 71.74% 71.86% +0.12%
- Complexity 62904 62963 +59
============================================
Files 5178 5182 +4
Lines 295167 295359 +192
Branches 42679 42701 +22
============================================
+ Hits 211774 212268 +494
+ Misses 66011 65663 -348
- Partials 17382 17428 +46 ☔ View full report in Codecov by Sentry. |
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 also look into increasing the code coverage, seems pretty low right now. Lets aim to keep it above 80%.
server/src/main/java/org/opensearch/cluster/metadata/IndexNameExpressionResolver.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/action/admin/indices/tiering/TieringUtils.java
Outdated
Show resolved
Hide resolved
final TieringUpdateClusterStateRequest updateClusterStateRequest = new TieringUpdateClusterStateRequest( | ||
tieringValidationResult.getRejectedIndices(), | ||
request.waitForCompletion() | ||
).ackTimeout(request.timeout()) |
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.
where is this ackTimeout
used ?
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.
server/src/main/java/org/opensearch/indices/tiering/HotToWarmTieringService.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
public void markTiered() { | ||
this.state = IndexTieringState.TIERED; | ||
} |
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.
looks like a state machine, do we need to validate the transitions are happening in the correct sequence?
Signed-off-by: Neetika Singhal <[email protected]>
7da1aa6
to
d99f55f
Compare
void processTieringRequestContexts(final ClusterState clusterState) { | ||
final Map<Index, TieringRequestContext> tieredIndices = new HashMap<>(); | ||
for (TieringRequestContext tieringRequestContext : tieringRequestContexts) { | ||
if (tieringRequestContext.isRequestProcessingComplete()) { |
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.
this check handles the cases where as indices are failed as part of the request
This PR is stalled because it has been open for 30 days with no activity. |
This PR is stalled because it has been open for 30 days with no activity. |
@neetikasinghal Are you still working on this? Looks like we need a few merge conflicts addressed. Otherwise is it ready for review? |
Description
Related Issues
#14545
#13980
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.