container-storage-interface / spec

Container Storage Interface (CSI) Specification.
Apache License 2.0
1.34k stars 373 forks source link

`CreateSnapshot` API should support both `sync` and `async` mode #556

Open astraw99 opened 11 months ago

astraw99 commented 11 months ago

Is your feature request related to a problem?/Why is this needed Currently, the CreateSnapshot API is a synchronous call and it blocked until the snapshot is cut, as said in the doc:

Based on this information, CO can issue repeated (idempotent) calls to CreateSnapshot, monitor the response, and make decisions. Note that CreateSnapshot is a synchronous call and it MUST block until the snapshot is cut.

But creating snapshot from disk may take long time, depends on the data size. The issue is the synchronous mode will be stucked and may be broken if any error occured.

So raised this issue to support both sync and async mode on CreateSnapshot API.

Describe the solution you'd like in detail In the async mode, CreateSnapshot API will get the snapshotID very quickly from the SP (Storage Provider), then we can call query API to get the snapshot status or progress.

In the meantime, the FrontEnd could display the snapshot progress user-friendly.

Describe alternatives you've considered We can add a param as mode="sync|async" to support both mode, let user choose as they like.

Additional context It is a common issue among cloud SPs, hope this proposal will get acceptance, then I can do the PR to implement it.

jdef commented 11 months ago

It's unclear to me how async comm resolves the problems described here. Async calls could also hang. Async connections can also be disrupted, in which case an idempotent repeat call is needed anyway.

This smells like a solution hunting for a problem.

On Thu, Nov 2, 2023, 10:35 AM Cheng Wang @.***> wrote:

Is your feature request related to a problem?/Why is this needed Currently, the CreateSnapshot API is a synchronous call and it blocked until the snapshot is cut, as said in the doc:

Based on this information, CO can issue repeated (idempotent) calls to CreateSnapshot, monitor the response, and make decisions. Note that CreateSnapshot is a synchronous call and it MUST block until the snapshot is cut.

But creating snapshot from disk may take long time, depends on the data size. Issue is the synchronous mode will be stucked and may be broken if any error occured.

So raised this issue to support both sync and async mode CreateSnapshot API.

Describe the solution you'd like in detail In the async mode, CreateSnapshot API will get the snapshotID very quickly from the SP (Storage Provider), then we can call query API to get the snapshot status or progress.

In the meantime, the FrontEnd could display the snapshot progress user-friendly.

Describe alternatives you've considered We can add a param as mode="sync|async" to support both mode, let user choose as they like.

Additional context It is a common issue among cloud SPs, hope this proposal will get accepted, then I can do the PR to implement it.

— Reply to this email directly, view it on GitHub https://github.com/container-storage-interface/spec/issues/556, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR5KLF57D4VAJWBSNKOKODYCOVTHAVCNFSM6AAAAAA6272GROVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE3TIMZZGYZDOMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jdef commented 11 months ago

E.g. the true problem being solved for here seems to be UX related. So maybe there are other ways to get at that?

On Thu, Nov 2, 2023, 12:46 PM James DeFelice @.***> wrote:

It's unclear to me how async comm resolves the problems described here. Async calls could also hang. Async connections can also be disrupted, in which case an idempotent repeat call is needed anyway.

This smells like a solution hunting for a problem.

On Thu, Nov 2, 2023, 10:35 AM Cheng Wang @.***> wrote:

Is your feature request related to a problem?/Why is this needed Currently, the CreateSnapshot API is a synchronous call and it blocked until the snapshot is cut, as said in the doc:

Based on this information, CO can issue repeated (idempotent) calls to CreateSnapshot, monitor the response, and make decisions. Note that CreateSnapshot is a synchronous call and it MUST block until the snapshot is cut.

But creating snapshot from disk may take long time, depends on the data size. Issue is the synchronous mode will be stucked and may be broken if any error occured.

So raised this issue to support both sync and async mode CreateSnapshot API.

Describe the solution you'd like in detail In the async mode, CreateSnapshot API will get the snapshotID very quickly from the SP (Storage Provider), then we can call query API to get the snapshot status or progress.

In the meantime, the FrontEnd could display the snapshot progress user-friendly.

Describe alternatives you've considered We can add a param as mode="sync|async" to support both mode, let user choose as they like.

Additional context It is a common issue among cloud SPs, hope this proposal will get accepted, then I can do the PR to implement it.

— Reply to this email directly, view it on GitHub https://github.com/container-storage-interface/spec/issues/556, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR5KLF57D4VAJWBSNKOKODYCOVTHAVCNFSM6AAAAAA6272GROVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE3TIMZZGYZDOMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

astraw99 commented 11 months ago

Async mode is like this: CreateSnapshot => snapshotID, (sync call) ListSnapshots => query snapshot status by snapshotID. (sync call) With this logic, we can support CreateSnapshot API both sync(default) and async mode, and get a better UX.

@jdef PTAL thanks.