-
Notifications
You must be signed in to change notification settings - Fork 114
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
SM dev - state machine #370
SM dev - state machine #370
Conversation
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
79ddc1e
to
c502e66
Compare
Codecov Report
@@ Coverage Diff @@
## sm-dev #370 +/- ##
============================================
+ Coverage 75.31% 75.85% +0.53%
- Complexity 2345 2428 +83
============================================
Files 298 309 +11
Lines 13517 14179 +662
Branches 2072 2178 +106
============================================
+ Hits 10181 10755 +574
- Misses 2190 2222 +32
- Partials 1146 1202 +56
Continue to review full report at Codecov.
|
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
d6a547b
to
58dc8e2
Compare
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: Clay Downs <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
e1d6e00
to
2caa004
Compare
Signed-off-by: bowenlan-amzn <[email protected]>
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMRunner.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMRunner.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/engine/SMStateMachine.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/engine/SMStateMachine.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/engine/SMStateMachine.kt
Outdated
Show resolved
Hide resolved
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/engine/SMStateMachine.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/engine/SMStateMachine.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/engine/SMStateMachine.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/engine/SMStateMachine.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/engine/SMStateMachine.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMRunner.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMRunner.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMRunner.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMRunner.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt
Show resolved
Hide resolved
...nsearch/indexmanagement/snapshotmanagement/api/transport/explain/TransportExplainSMAction.kt
Show resolved
Hide resolved
...earch/indexmanagement/snapshotmanagement/api/transport/index/TransportIndexSMPolicyAction.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/engine/SMStateMachine.kt
Show resolved
Hide resolved
Few high level question -
Also, I didn't get chance to look at the UTs, I'm not if we have a way here to post the overall coverage impact with this change. |
|
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
3674b92
to
32a4f25
Compare
Signed-off-by: bowenlan-amzn <[email protected]>
b6e2fbd
to
312c8e8
Compare
...earch/indexmanagement/snapshotmanagement/api/transport/index/TransportIndexSMPolicyAction.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/engine/states/State.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/model/SMMetadata.kt
Show resolved
Hide resolved
...g/opensearch/indexmanagement/snapshotmanagement/engine/states/creation/CreationStartState.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SMUtils.kt
Outdated
Show resolved
Hide resolved
...pensearch/indexmanagement/snapshotmanagement/engine/states/creation/CreationFinishedState.kt
Show resolved
Hide resolved
...in/org/opensearch/indexmanagement/snapshotmanagement/engine/states/deletion/DeletingState.kt
Show resolved
Hide resolved
...in/org/opensearch/indexmanagement/snapshotmanagement/engine/states/deletion/DeletingState.kt
Show resolved
Hide resolved
...in/org/opensearch/indexmanagement/snapshotmanagement/engine/states/deletion/DeletingState.kt
Show resolved
Hide resolved
...pensearch/indexmanagement/snapshotmanagement/engine/states/deletion/DeletionFinishedState.kt
Show resolved
Hide resolved
4616d73
to
4ef0f2b
Compare
Signed-off-by: bowenlan-amzn <[email protected]>
4ef0f2b
to
5ea28cd
Compare
Left un-resolved comments will be addressed in the future snapshot management PRs due to development time conflicts. |
thanks! please compile a list of important ones to fix from here, before release. |
Agreed, would be great if we could start generating a master list of what we want to do before release and important enhancements for post release if we don't have time! |
Issue #, if available:
#280
Description of changes:
This PR add the core logic for Snapshot Management (SM), which is implemented as a state machine.
Simplified to below now:
All the operations of snapshot management are placed in different SMState. After one SMState finishes all its operations, it returns the Next SMResult to inform the SMStateMachine (Context object) to save the finished SMState as currentState, so that the next scheduled job would execute the next SMState based on transitions. On the other hand, if the SMState cannot finish all operations (e.g. check if current time passes the next execution period [1]), it will return Stay SMResult to inform the SMStateMachine to save previous state as the currentState, so that the next scheduled job [2] executes the same SMState again.
Snapshot management has 2 workflows for now: creation and deletion. These 2 workflows are executed sequentially in one scheduled job run. Please refer to the
SMStateMachine.next
part in SMRunner. So these 2 workflows run in parallel from user's perspective, with their own set of metadata.If your snapshot creation time is longer than the execution period, the execution period would be skipped. But if the
time_limit
parameter is provided, then if the creation time has passed thetime_limit,
state machine directly goes to next execution period w/o waiting for the previous creation to be finished.Failure handling: this state machine won't fail and stop, it would reset the workflow (set the related metadata of this workflow to null) after 3 retries and go to the next execution period. It can also notify the user once notification is integrated.
Glossary:
Q&A
Why not using 2 scheduled jobs for creation and deletion workflows?
The complexity or risk of doing it in single job is less:
CheckList:
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.