-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Change SnapshotStatus enum to a boolean #307
Change SnapshotStatus enum to a boolean #307
Conversation
23eed7e
to
d417e19
Compare
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.
👍
8de19ce
to
35c9d13
Compare
Thanks @julian-hj . |
spec.md
Outdated
// LIST_SNAPSHOTS is NOT REQUIRED. For plugins that need to | ||
// process a snapshot after it is being cut, LIST_SNAPSHOTS | ||
// COULD be used with the snapshot_id as the filter to query | ||
// whether the processing is complete or not. |
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.
For plugins that need to a snapshot after it is being cut, LIST_SNAPSHOTS COULD be used with the snapshot_id as the filter to query whether the processing is complete or not.
^^This is no longer required right? CO should call CreateVolume
again to poll the is_ready_to_use
to use state.
If so, let's remove this.
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.
Done
spec.md
Outdated
@@ -1405,12 +1405,12 @@ A Controller Plugin MUST implement this RPC call if it has `CREATE_DELETE_SNAPSH | |||
This RPC will be called by the CO to create a new snapshot from a source volume on behalf of a user. | |||
|
|||
This operation MUST be idempotent. | |||
If a snapshot corresponding to the specified snapshot `name` is already successfully cut and uploaded (if upload is part of the process) and is compatible with the specified `source_volume_id` and `parameters` in the `CreateSnapshotRequest`, the Plugin MUST reply `0 OK` with the corresponding `CreateSnapshotResponse`. | |||
If a snapshot corresponding to the specified snapshot `name` is already successfully cut and processed (i.e., if upload is part of the process) and is compatible with the specified `source_volume_id` and `parameters` in the `CreateSnapshotRequest`, the Plugin MUST reply `0 OK` with the corresponding `CreateSnapshotResponse`. |
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.
Change this to:
If a snapshot corresponding to the specified snapshot
name
is successfully cut and ready to use (meaning it may be specified as avolume_content_source
in aCreateSnapshotRequest
) , the Plugin MUST reply0 OK
with the correspondingCreateSnapshotResponse
.
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.
Done
spec.md
Outdated
|
||
If an error occurs before a snapshot is cut, `CreateSnapshot` SHOULD return a corresponding gRPC error code that reflects the error condition. | ||
|
||
For plugins that implement snapshot uploads, `CreateSnapshot` SHOULD return `10 ABORTED`, a gRPC code that indicates the operation is pending for snapshot, during the snapshot uploading processs. | ||
If an error occurs during the uploading process, `CreateSnapshot` SHOULD return a corresponding gRPC error code that reflects the error condition. | ||
For plugins that supports snapshot post processing such as uploading, `CreateSnapshot` SHOULD return `0 OK` and `is_ready_to_use` SHOULD be set to `false` after the snapshot is cut but still being processed. |
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.
Add the following:
CO SHOULD then reissue the same
CreateSnapshotRequest
periodically untilboolean isReadyToUse
flips totrue
indicating the volume has been "processed" and is ready to use to create new Snapshots.
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.
Done
spec.md
Outdated
// Additional information to describe why a snapshot ended up in the | ||
// `ERROR_UPLOADING` status. This field is OPTIONAL. | ||
string details = 2; | ||
// Indicates if a snapshot is ready to use. The default value is |
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.
Indicates if a snapshot is ready to use.
-> Indicates if a snapshot is ready to use as a volume_content_source in a CreateSnapshotRequest.
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.
Done
spec.md
Outdated
A controller plugin COULD implement the `LIST_SNAPSHOTS` capability and call it repeatedly with the `snapshot_id` as a filter to query whether the uploading process is complete or not if it needs to upload a snapshot after it is being cut. | ||
|
||
##### Snapshot Statuses | ||
A controller plugin COULD implement the `LIST_SNAPSHOTS` capability and call it repeatedly with the `snapshot_id` as a filter to query whether the process is complete or not if it needs to do post processing such as uploading a snapshot after it is being cut. |
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.
Let's drop this line. We should recommend calling CreateSnapshot
again instead of List, so they can get an error code.
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.
Done
spec.md
Outdated
If the cloud provider or storage system needs to upload the snapshot after the snapshot is cut, the status returned by CreateSnapshot SHALL be `UPLOADING`. | ||
CO MAY continue to call CreateSnapshot while waiting for the upload to complete until the status becomes `READY`. | ||
If the cloud provider or storage system does not need to process the snapshot (i.e., upload the snapshot) after it is cut, the `is_ready_to_use` parameter returned by CreateSnapshot SHALL be `true`. | ||
If the cloud provider or storage system needs to process the snapshot after the snapshot is cut, the `is_ready_to_use` parameter returned by CreateSnapshot SHALL be `false`. |
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.
Move this line to right after lines 1646-1647
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.
Done
spec.md
Outdated
CO MAY continue to call CreateSnapshot while waiting for the upload to complete until the status becomes `READY`. | ||
If the cloud provider or storage system does not need to process the snapshot (i.e., upload the snapshot) after it is cut, the `is_ready_to_use` parameter returned by CreateSnapshot SHALL be `true`. | ||
If the cloud provider or storage system needs to process the snapshot after the snapshot is cut, the `is_ready_to_use` parameter returned by CreateSnapshot SHALL be `false`. | ||
CO MAY continue to call CreateSnapshot while waiting for the process to complete until `is_ready_to_use` becomes `true`. |
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 line is very similar to 1654. Delete and combine with that.
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.
Done
spec.md
Outdated
Note that CreateSnapshot no longer blocks after the snapshot is cut. | ||
|
||
Alternatively, ListSnapshots can be called repeatedly with snapshot_id as filtering to wait for the upload to complete. | ||
Alternatively, ListSnapshots can be called repeatedly with snapshot_id as filtering to wait for the process to complete. |
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 would not recommend this. Suggest dropping this line.
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.
Done
spec.md
Outdated
ListSnapshots SHALL return with current information regarding the snapshots on the storage system. | ||
When upload is complete, the status of the snapshot from ListSnapshots SHALL become `READY`. | ||
When the process is complete, the `is_ready_to_use` parameter of the snapshot from ListSnapshots SHALL become `true`. |
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.
When the process is complete
-> When processing is complete
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.
Done
spec.md
Outdated
|
||
A snapshot could have the following statusus: UPLOADING, READY, and ERROR. | ||
##### The is_ready_to_use Parameter |
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 would move this section (everything from line 1635 to 1658) up to the CreateSnapshot section of the doc. It doesn't make sense under ListSnapshot.
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.
Done
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.
Hmm, I'm still seeing this under ListSnapshots? Move everything from here to line 1656
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.
So I'm moving the entire "##### The is_ready_to_use Parameter" section until line 1656 to the "#### CreateSnapshot
" section. I believed that is what you meant? This current section is called "##### CreateSnapshot
, DeleteSnapshot
, ListSnapshots
". So I am a little confused when you said "under ListSnapshot".
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.
Addressed review comments. Thanks.
spec.md
Outdated
// LIST_SNAPSHOTS is NOT REQUIRED. For plugins that need to | ||
// process a snapshot after it is being cut, LIST_SNAPSHOTS | ||
// COULD be used with the snapshot_id as the filter to query | ||
// whether the processing is complete or not. |
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.
Done
spec.md
Outdated
@@ -1405,12 +1405,12 @@ A Controller Plugin MUST implement this RPC call if it has `CREATE_DELETE_SNAPSH | |||
This RPC will be called by the CO to create a new snapshot from a source volume on behalf of a user. | |||
|
|||
This operation MUST be idempotent. | |||
If a snapshot corresponding to the specified snapshot `name` is already successfully cut and uploaded (if upload is part of the process) and is compatible with the specified `source_volume_id` and `parameters` in the `CreateSnapshotRequest`, the Plugin MUST reply `0 OK` with the corresponding `CreateSnapshotResponse`. | |||
If a snapshot corresponding to the specified snapshot `name` is already successfully cut and processed (i.e., if upload is part of the process) and is compatible with the specified `source_volume_id` and `parameters` in the `CreateSnapshotRequest`, the Plugin MUST reply `0 OK` with the corresponding `CreateSnapshotResponse`. |
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.
Done
spec.md
Outdated
|
||
If an error occurs before a snapshot is cut, `CreateSnapshot` SHOULD return a corresponding gRPC error code that reflects the error condition. | ||
|
||
For plugins that implement snapshot uploads, `CreateSnapshot` SHOULD return `10 ABORTED`, a gRPC code that indicates the operation is pending for snapshot, during the snapshot uploading processs. | ||
If an error occurs during the uploading process, `CreateSnapshot` SHOULD return a corresponding gRPC error code that reflects the error condition. | ||
For plugins that supports snapshot post processing such as uploading, `CreateSnapshot` SHOULD return `0 OK` and `is_ready_to_use` SHOULD be set to `false` after the snapshot is cut but still being processed. |
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.
Done
spec.md
Outdated
// Additional information to describe why a snapshot ended up in the | ||
// `ERROR_UPLOADING` status. This field is OPTIONAL. | ||
string details = 2; | ||
// Indicates if a snapshot is ready to use. The default value is |
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.
Done
spec.md
Outdated
A controller plugin COULD implement the `LIST_SNAPSHOTS` capability and call it repeatedly with the `snapshot_id` as a filter to query whether the uploading process is complete or not if it needs to upload a snapshot after it is being cut. | ||
|
||
##### Snapshot Statuses | ||
A controller plugin COULD implement the `LIST_SNAPSHOTS` capability and call it repeatedly with the `snapshot_id` as a filter to query whether the process is complete or not if it needs to do post processing such as uploading a snapshot after it is being cut. |
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.
Done
spec.md
Outdated
If the cloud provider or storage system does not need to upload the snapshot after it is cut, the status returned by CreateSnapshot SHALL be `READY`. | ||
If the cloud provider or storage system needs to upload the snapshot after the snapshot is cut, the status returned by CreateSnapshot SHALL be `UPLOADING`. | ||
CO MAY continue to call CreateSnapshot while waiting for the upload to complete until the status becomes `READY`. | ||
If the cloud provider or storage system does not need to process the snapshot (i.e., upload the snapshot) after it is cut, the `is_ready_to_use` parameter returned by CreateSnapshot SHALL be `true`. |
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.
Done
spec.md
Outdated
If the cloud provider or storage system needs to upload the snapshot after the snapshot is cut, the status returned by CreateSnapshot SHALL be `UPLOADING`. | ||
CO MAY continue to call CreateSnapshot while waiting for the upload to complete until the status becomes `READY`. | ||
If the cloud provider or storage system does not need to process the snapshot (i.e., upload the snapshot) after it is cut, the `is_ready_to_use` parameter returned by CreateSnapshot SHALL be `true`. | ||
If the cloud provider or storage system needs to process the snapshot after the snapshot is cut, the `is_ready_to_use` parameter returned by CreateSnapshot SHALL be `false`. |
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.
Done
spec.md
Outdated
CO MAY continue to call CreateSnapshot while waiting for the upload to complete until the status becomes `READY`. | ||
If the cloud provider or storage system does not need to process the snapshot (i.e., upload the snapshot) after it is cut, the `is_ready_to_use` parameter returned by CreateSnapshot SHALL be `true`. | ||
If the cloud provider or storage system needs to process the snapshot after the snapshot is cut, the `is_ready_to_use` parameter returned by CreateSnapshot SHALL be `false`. | ||
CO MAY continue to call CreateSnapshot while waiting for the process to complete until `is_ready_to_use` becomes `true`. |
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.
Done
spec.md
Outdated
Note that CreateSnapshot no longer blocks after the snapshot is cut. | ||
|
||
Alternatively, ListSnapshots can be called repeatedly with snapshot_id as filtering to wait for the upload to complete. | ||
Alternatively, ListSnapshots can be called repeatedly with snapshot_id as filtering to wait for the process to complete. |
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.
Done
spec.md
Outdated
ListSnapshots SHALL return with current information regarding the snapshots on the storage system. | ||
When upload is complete, the status of the snapshot from ListSnapshots SHALL become `READY`. | ||
When the process is complete, the `is_ready_to_use` parameter of the snapshot from ListSnapshots SHALL become `true`. |
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.
Done
a0c3de8
to
8d99c5f
Compare
spec.md
Outdated
|
||
A snapshot could have the following statusus: UPLOADING, READY, and ERROR. | ||
##### The is_ready_to_use Parameter |
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.
Hmm, I'm still seeing this under ListSnapshots? Move everything from here to line 1656
spec.md
Outdated
Some cloud providers will upload the snapshot to a location in the cloud (i.e., an object store) after the snapshot is cut. | ||
Uploading may be a long process that could take hours. | ||
If a `freeze` operation was done on the application before taking the snapshot, it could be a long time before the application can be running again if we wait until the upload is complete to `thaw` the application. | ||
Some cloud providers will process the snapshot after the snapshot is cut, i.e., uploading the snapshot to a location in the cloud (i.e., an object store) after the snapshot is cut. |
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.
Some cloud providers will process...
-> Some SPs MAY "process"...
...cut, i.e., uploading...
-> ...cut, for example, maybe uploading...
...to a location in the cloud (i.e., an object store) after the snapshot is cut.
-> ...somewhere after the snapshot is cut.
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.
Done
spec.md
Outdated
Uploading may be a long process that could take hours. | ||
If a `freeze` operation was done on the application before taking the snapshot, it could be a long time before the application can be running again if we wait until the upload is complete to `thaw` the application. | ||
Some cloud providers will process the snapshot after the snapshot is cut, i.e., uploading the snapshot to a location in the cloud (i.e., an object store) after the snapshot is cut. | ||
A process such as uploading may be a long process that could take hours. |
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.
A process such as uploading may...
-> The post-cut process may...
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.
Done
spec.md
Outdated
If a `freeze` operation was done on the application before taking the snapshot, it could be a long time before the application can be running again if we wait until the upload is complete to `thaw` the application. | ||
Some cloud providers will process the snapshot after the snapshot is cut, i.e., uploading the snapshot to a location in the cloud (i.e., an object store) after the snapshot is cut. | ||
A process such as uploading may be a long process that could take hours. | ||
If a `freeze` operation was done on the application before taking the snapshot, it could be a long time before the application can be running again if we wait until the process is complete to `thaw` the application. |
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.
Change this line to:
The CO may
freeze
the application using the source volume before taking the snapshot.
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.
Done
spec.md
Outdated
|
||
For cloud providers and storage systems that don't have the uploading process, the status should be `READY` after the snapshot is cut. | ||
`thaw` can be done when the status is `READY` in this case. | ||
For cloud providers and storage systems that don't have the process, the `is_ready_to_use` parameter should be `true` after the snapshot is cut. |
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.
Find and replace all instances of
should
-> SHOULD
may
-> MAY
must
-> MUST
At least the bits you are touching in this PR. I will open a PR addressing the rest of the spec.
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.
Done
spec.md
Outdated
|
||
The SnapshotStatus parameter provides guidance to the CO on what action can be taken in the process of snapshotting. | ||
The `is_ready_to_use` parameter provides guidance to the CO on what action can be taken in the process of snapshotting. |
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.
Move this before line 1647.
Change on what action can be taken
-> on when it can "thaw" the application
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.
Done
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
But I'm coming in late on this discussion so I may have missed a detail in there
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.
Sorry one last (promise no more) set of changes.
csi.proto
Outdated
// a snapshot after it is being cut, LIST_SNAPSHOTS COULD be used | ||
// with the snapshot_id as the filter to query whether the | ||
// uploading process is complete or not. | ||
// LIST_SNAPSHOTS is NOT REQUIRED. |
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 don't think we need this comment at all now.
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.
Removed.
csi.proto
Outdated
// Indicates if a snapshot is ready to use as a | ||
// `volume_content_source` in a `CreateVolumeRequest`. The default | ||
// value is false. This field is REQUIRED. | ||
bool is_ready_to_use = 5; |
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.
Let's change this to ready_to_use
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.
Done
spec.md
Outdated
During the snapshot processing phase, since the snapshot is already cut, a `thaw` operation can be performed so application can start running without waiting for the process to complete. | ||
The `is_ready_to_use` parameter of the snapshot will become `true` after the process is complete. | ||
|
||
For cloud providers and storage systems that don't have the process, the `is_ready_to_use` parameter SHOULD be `true` after the snapshot is cut. |
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.
Change to:
For SPs that do not do additional processing after cut, the
is_ready_to_use
parameter SHOULD betrue
after the snapshot is cut.
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.
Done
7a51cbf
to
0d1fd2a
Compare
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
/approve
This PR changes SnapshotStatus enum to a boolean is_ready_to_use and tries to use "processing" instead of "uploading" if possible to make it less specific.
0d1fd2a
to
546096b
Compare
This PR changes SnapshotStatus enum to a boolean
is_ready_to_use
and tries to use "processing" instead of "uploading" if possible
to make it less specific.
fixes #302