strato icon indicating copy to clipboard operation
strato copied to clipboard

[Cloud Block Service] AWS Volume shows status available. On modifying throws error cannot be modified when state is MODIFYING or OPTIMIZING.

Open anvithks opened this issue 3 years ago • 15 comments

Issue/Feature Description: When a volume that is newly created is modified the status is shown as available. After the status is shown available if another modify request is sent the backend throws an error which has no information (panic error). On checking the docker logs the below error is shown.

On trying to modify a volume which is in MODIFYING or OPTIMIZING state the API throws an error.

These states can be fetched from the cloud backend and returned in the API to give the user correct information

[2020-09-28T21:49:21+05:30] [ERROR] [/root/gopath/src/github.com/sodafoundation/multi-cloud/contrib/datastore/block/aws/aws.go] [aws.(*AwsAdapter).UpdateVolume():318] [PID:1] Error in updating volume: {
  Iops: 0,
  Size: 600,
  VolumeId: "vol-08986585387cd1eff",
  VolumeType: "st1"
}%!(EXTRA *awserr.requestError=IncorrectModificationState: Volume vol-08986585387cd1eff cannot be modified in modification state MODIFYING
	status code: 400, request id: 7e2390e5-7d2c-415b-af3a-9bd49857b5bd)
[2020-09-28T21:49:21+05:30] [ERROR] [/root/gopath/src/github.com/sodafoundation/multi-cloud/contrib/datastore/block/aws/aws.go] [aws.(*AwsAdapter).UpdateVolume():322] [PID:1] IncorrectModificationState: Volume vol-08986585387cd1eff cannot be modified in modification state MODIFYING

Why this issue to fixed / feature is needed(give scenarios or use cases): If the state is shown as available then the user will try to modify. we are already showing creating and updating as intermediate states wherein a user will expect some change. Similarly showing the state as modifying or optimizing as per the cloud vendor will give more accurate information to the user and will also help in preventing making API calls to the backend when certain states do not allow it.

How to reproduce, in case of a bug:

Other Notes / Environment Information: (Please give the env information, log link or any useful information for this issue)

anvithks avatar Sep 28 '20 16:09 anvithks

Should be fixed in next release. Reason for not fixing in Greenland release Less chances that so frequent modification will be done in actual/production environment

kumarashit avatar Sep 28 '20 18:09 kumarashit

@anvithks @kumarashit This is as expected from AWS Cloud Backend

@anvithks Could you please update the issue with the Response from API

himanshuvar avatar Sep 29 '20 05:09 himanshuvar

The issue is wrt the status in the SODA API response not matching the AWS Cloud backend error. The SODA API returns status as available. When the user tries to modify it throws above error.

You can check the scenario in the below screenshots.

  1. Created a GP volume with 100GB : available image

  2. Docker logs image

  3. API response in the Modify volume page image

  4. Docker logs in the modify volume page. image

  5. Modified the size to 500GB. Status is updating image

  6. API response is updating. image

  7. Status is now available. image

Docker logs image

  1. Modify request sent. Size increased to 750GB. Status is available but the cannot modify as modification state is OPTIMIZING. image

anvithks avatar Sep 29 '20 05:09 anvithks

@anvithks Could you please share Response for Step 8

himanshuvar avatar Sep 29 '20 05:09 himanshuvar

The API response image

anvithks avatar Sep 29 '20 05:09 anvithks

@anvithks Is this PUT Response for 750 GB?, Context Deadline exceeded was fixed using go routine. PUT API should return some response in terms of Error.

himanshuvar avatar Sep 29 '20 05:09 himanshuvar

@anvithks I suggest try same operations on AWS cloud Backend, and notice the behavior of Request/Response from AWS console.

himanshuvar avatar Sep 29 '20 05:09 himanshuvar

Yes @himanshuvar. This is for PUT. This setup was made last night.

anvithks avatar Sep 29 '20 05:09 anvithks

@anvithks I suggest try same operations on AWS cloud Backend, and notice the behavior of Request/Response from AWS console.

SODA clients will communicate with the SODA backend. The response we receive from the SODA backend willl be considered the same as that of the cloud vendor.

anvithks avatar Sep 29 '20 05:09 anvithks

@anvithks I suggest try same operations on AWS cloud Backend, and notice the behavior of Request/Response from AWS console.

SODA clients will communicate with the SODA backend. The response we receive from the SODA backend willl be considered the same as that of the cloud vendor.

Yes, I understand that SODA APIs & Clients communication should be in sync. If SODA clients expect something on some operations that is not given back from SODA APIs is certainly an issue in the APIs I have suggested the Cloud operation just to make our understanding clear about the AWS cloud operations. What is the expected behavior for their call operations. i.e. On modifying throws error cannot be modified when state is MODIFYING or OPTIMIZING -> How AWS response to this operation.

himanshuvar avatar Sep 29 '20 06:09 himanshuvar

This is how AWS console works. Hope this helps.

Modify prompt image

Modify Success image

Intermediate state. Volume is available but there is a modification state maintained and returned in the API. Denoted with yellow color next to available in the list. image

API with modification state image

Error when trying to modify the volume when in optimizing state. image

Error from API image

anvithks avatar Sep 29 '20 09:09 anvithks

Thanks @anvithks for confirming the operations from AWS Cloud Backend. I have tested the exact operations with master branch using POSTMAN client, Please find the results below. Hope you are also executing the above results on latest code.

  1. Create a 100GB gp2 Volume using SODA multi-cloud Block API 1

docker logs for creating a 100GB Volume 2

Volume is created at AWS backend, can be seen in AWS console as below 3

  1. Get Volume, created in Step 1 using SODA multi-cloud Block API 4

  2. Update Volume to 500GB using SODA multi-cloud Block API 5

docker logs 6

Volume is Updated at AWS backend, can be seen in AWS console as below 7

  1. Get Volume, updated in Step 3 using SODA multi-cloud Block API 8

  2. Update Volume to 750GB using SODA multi-cloud Block API. THIS IS A FAILED OPERATION 9

This Calls returns the error with the valid reasons response from backend

docker logs 10

  1. Get Volume using SODA multi-cloud Block API, Volume is in its old STATE which is an expected behavior 11

Volume is in its old STATE which is an expected behavior at AWS backend, can be seen in AWS console as below 12 Volume Resource is maintained at the SODA Backend as AWS Backend

@kumarashit Please look into above findings. Please let me know if above SODA multi-cloud API's request/response are correct or not. Please let us know if any other API behavior expectated for these API calls.

@kumarashit @anvithks Let me know if there is any gap from my side in understanding the expected SODA multi-cloud backend APIs requirements.

himanshuvar avatar Sep 29 '20 10:09 himanshuvar

AWS adds the modification state to the response when the volume is modifying as shown here. image

if the modification state is returned in SODA API then we can preempt making any requests for modification when the volume is in any of the intermediate states. AWS uses the colored dot next to the state name to indicate the intermediate state. An available volume is shown in green. An available volume in OPTIMIZING or MODIFYING state is shown with a yellow dot.

If the client receives the modification state object as shown above then making another request for modification can be prevented.

anvithks avatar Sep 29 '20 12:09 anvithks

@anvithks This is another approach to leverage the STATE model from a cloud vendor into SODA, but I don't think this Approach is feasible in SODA because of the following reasons:

  1. SODA doesn't support Operation Handling. Its just a placeholder for the provisioning & metadata etc.
  2. Approach is not scalable for extending the other Cloud vendor support as the other cloud vendor might not support the same STATE models as AWS like OPTIMIZING or MODIFYING. So we can't go with AWS biasing in SODA unless that is standard across multi-cloud vendors.
  3. The PUT API calls can't be restricted based on the STATE model only. There are other factors/Errors need to be considered like Operation permitted within time limit that anyways are handled from cloud backend so as by SODA multi-cloud API.

Instead of confusing the Users for different states, the API request/response can be used for managing API calls that is already supported in the API. Client should utilize the API response properly.

himanshuvar avatar Sep 29 '20 13:09 himanshuvar

@himanshuvar

SODA doesn't support Operation Handling. Its just a placeholder for the provisioning & metadata etc.

Could you please elaborate a bit on this. Not sure I understand this correctly.

Approach is not scalable for extending the other Cloud vendor support as the other cloud vendor might not support the same STATE models as AWS like OPTIMIZING or MODIFYING. So we can't go with AWS biasing in SODA unless that is standard across multi-cloud vendors.

True. But we need to have a mechanism that would allow cloud vendor specific restrictions, validations or responses to be available to the client. For ex: in the current volume modify issue, a user who may be using SODA APIs will not be able to know that the status is available but in another intermediate state. Even if it is a valid scenario to throw an error it doesn't add up to a clean experience.

The PUT API calls can't be restricted based on the STATE model only. There are other factors/Errors need to be considered like Operation permitted within time limit that anyways are handled from cloud backend so as by SODA multi-cloud API.

With a front end client you do, in fact, get some amount of logic that can control the number of calls that need to be made to the backend. using the APIs directly using any REST client will still work as you explained above. If some of the limits and validations are known to us then we can leverage the same in the SODA APIs to make the usage more inline with e cloud backend. If the SODA APIs will only pass the error from the cloud vendor backend then this may lead to many wasted calls from the client.

Instead of confusing the Users for different states, the API request/response can be used for managing API calls that is already supported in the API. Client should utilize the API response properly.

The users will in fact be in a confused state when they see an error for an available volume. This is my main concern. if the status is available and there is no way for the user to know that the volume may not be modified how do we inform the user abou the same.

anvithks avatar Sep 29 '20 13:09 anvithks