-
Notifications
You must be signed in to change notification settings - Fork 814
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
Don't wait for the snapshot to be completed #209
Don't wait for the snapshot to be completed #209
Conversation
Pull Request Test Coverage Report for Build 440
💛 - Coveralls |
Pull Request Test Coverage Report for Build 450
💛 - Coveralls |
pkg/cloud/cloud.go
Outdated
@@ -732,7 +740,7 @@ func (c *cloud) waitForSnapshotCreate(ctx context.Context, snapshotID *string) e | |||
case "completed": | |||
return true, nil | |||
case "pending": | |||
return false, nil | |||
return true, nil |
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.
Since we are always returning true here, do we still need this waitForSnapshotCreate
when creating snapshot? Can we just check the snapshot state returned from the CreateSnapshotWithContext
?
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.
Yes, this is rather paranoid -- I only wanted to be sure DescribeSnapshotsWithContext
can find the newly created snapshot.
SnapshotID: aws.StringValue(ec2Snapshot.SnapshotId), | ||
SourceVolumeID: aws.StringValue(ec2Snapshot.VolumeId), | ||
Size: snapshotSize, | ||
CreationTime: aws.TimeValue(ec2Snapshot.StartTime), | ||
} | ||
if aws.StringValue(ec2Snapshot.State) == "completed" { | ||
snapshot.ReadyToUse = 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.
snapshot.ReadyToUse = true | |
snapshot.ReadyToUse = aws.StringValue(ec2Snapshot.State) == "completed" |
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.
Will change it.
/cc @dkoshkin |
0a0872a
to
128122b
Compare
OK. I've removed the waiting method. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: leakingtapan, tsmetana The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…t/cherry-pick-208-to-release-4.11 [release-4.11] OCPBUGS-1749: UPSTREAM: 1398: Add resolver to handle custom endpoints
This patch changes the way the snapshots are being created: Originally the driver waited for the snapshot to complete. This is wrong since the snapshot creation may take a really long time. Also the gRPC would most likely timeout (the call is meant to be blocking) and cause all kinds of other problems.
Now the driver retruns the snapshot as soon as it appears in EC2 with ReadyToUse state in
false
and updates the state accordingly when the controller calls the SnapshotCreate again with the same parameters.