Skip to content
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

CreateSnapshot API should support both sync and async mode #556

Open
astraw99 opened this issue Nov 2, 2023 · 3 comments
Open

CreateSnapshot API should support both sync and async mode #556

astraw99 opened this issue Nov 2, 2023 · 3 comments

Comments

@astraw99
Copy link

astraw99 commented Nov 2, 2023

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.

@astraw99 astraw99 changed the title CreateSnapshot API should support both sync and asyn mode CreateSnapshot API should support both sync and async mode Nov 2, 2023
@jdef
Copy link
Member

jdef commented Nov 2, 2023 via email

@jdef
Copy link
Member

jdef commented Nov 2, 2023 via email

@astraw99
Copy link
Author

astraw99 commented Nov 3, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants