cloudfoundry / cloud_controller_ng

Cloud Foundry Cloud Controller
Apache License 2.0
194 stars 360 forks source link

State handling in v3 service instance endpoints #2713

Closed svkrieger closed 2 years ago

svkrieger commented 2 years ago

Legend

Icon Meaning
:white_check_mark: fixed/wanted behaviour
:x: not fixed but change of behaviour needed
:heavy_minus_sign: no change of behaviour needed
:question: questionable behaviour, needs further analysis

V3 API

The introduction of the Failed State for Broker operations does come with some unwanted behaviour in some cases. A first analysis and fix of the service binding endpoints was done here: https://github.com/cloudfoundry/cloud_controller_ng/issues/2637

This issue describes the findings regarding the service instance endpoints.

We made the assumption that a service instance which is in state update failed or delete failed, is still in a functioning state. The next OSBAPI spec version 2.16 "Allow[s] Service Brokers to indicate if a Service Instance is still usable after a failed update or deprovisioning" (https://github.com/openservicebrokerapi/servicebroker/blob/master/spec.md#changes-since-v215), which is currently not supported by the Cloud Controller. Furthermore, "If the broker does not indicate in the Error response or Last Operation response whether the Service Instance is usable or not, the Platform SHOULD assume it is still usable" (https://github.com/openservicebrokerapi/servicebroker/blob/master/spec.md#response-5).

Service Instances

POST /v3/service_instances (i.e. cf create-service) for already existing service instance

Resource State Observed Behaviour Wanted Behaviour PR Fixed in main
none (synchronous case) :question: :heavy_minus_sign:
create succeeded rejects request (1) :white_check_mark: :heavy_minus_sign:
create in progress rejects request (1) :white_check_mark: :heavy_minus_sign:
create failed rejects request (1) recreates instance https://github.com/cloudfoundry/cloud_controller_ng/pull/2730 :white_check_mark:
update succeeded rejects request (1) :white_check_mark: :heavy_minus_sign:
update in progress rejects request (1) :white_check_mark: :heavy_minus_sign:
update failed rejects request (1) :white_check_mark: :heavy_minus_sign:
delete failed rejects request (1) :white_check_mark: :heavy_minus_sign:
delete in progress rejects request (1) :white_check_mark: :heavy_minus_sign:

PATCH /v3/service_instances/:guid (i.e. cf update-service / upgrade-service) for already existing service-instance

Resource State Observed Behaviour Wanted Behaviour PR Fixed in main
none (synchronous case) :question: :heavy_minus_sign:
create succeeded accepts request :white_check_mark: :heavy_minus_sign:
create in progress rejects request (1) :white_check_mark: :heavy_minus_sign:
create failed accepts request returns an error (not exists) #2737 :white_check_mark:
update succeeded accepts request :white_check_mark: :heavy_minus_sign:
update in progress rejects request (1) :white_check_mark: :heavy_minus_sign:
update failed accepts request :white_check_mark: :heavy_minus_sign:
delete failed accepts request :white_check_mark: :heavy_minus_sign:
delete in progress rejects request (1) :white_check_mark: :heavy_minus_sign:

DELETE /v3/service_instances (i.e. cf delete-service) for already existing service-instance

Resource State Observed Behaviour Wanted Behaviour PR Fixed in main
none (synchronous case) :question: :heavy_minus_sign:
create succeeded accepts request :white_check_mark: :heavy_minus_sign:
create in progress accepts request :white_check_mark: :heavy_minus_sign:
create failed accepts request :white_check_mark: :heavy_minus_sign:
update succeeded accepts request :white_check_mark: :heavy_minus_sign:
update in progress rejects request (1) :white_check_mark: :heavy_minus_sign:
update failed accepts request :white_check_mark: :heavy_minus_sign:
delete failed accepts request :white_check_mark: :heavy_minus_sign:
delete in progress rejects request (1) :white_check_mark: :heavy_minus_sign:

POST /v3/spaces/:guid/actions/apply_manifest (i.e. cf push) for already existing service-instance

Resource State Observed Behaviour Wanted Behaviour PR Fixed in main
none (synchronous case) :question: :heavy_minus_sign:
create succeeded accepts request :white_check_mark: :heavy_minus_sign:
create in progress space.apply_manifest fails (1) :white_check_mark: :heavy_minus_sign:
create failed space.apply_manifest succeeds, binding is being created returns an error #2756 :white_check_mark:
update succeeded space.apply_manifest succeeds, binding is being created :white_check_mark: :heavy_minus_sign:
update in progress space.apply_manifest fails (1) :white_check_mark: :heavy_minus_sign:
update failed space.apply_manifest succeeds, binding is being created :white_check_mark: :heavy_minus_sign:
delete failed space.apply_manifest succeeds, binding is being created :white_check_mark: :heavy_minus_sign:
delete in progress space.apply_manifest fails (1) :white_check_mark: :heavy_minus_sign:

POST /v3/service_instances/:guid/relationships/shared_spaces (i.e. cf share-service) for already existing service-instance

Resource State Observed Behaviour Wanted Behaviour PR Fixed in main
none (synchronous case) :question: :heavy_minus_sign:
create succeeded Accepts request, service instance is being shared with another space :white_check_mark: :heavy_minus_sign:
create in progress Accepts request, service instance is being shared with another space returns an error (1) #2739 :white_check_mark:
create failed Accepts request, service instance is being shared with another space returns an error (not exists) #2739 :white_check_mark:
update succeeded Accepts request, service instance is being shared with another space :white_check_mark: :heavy_minus_sign:
update in progress Accepts request, service instance is being shared with another space :white_check_mark: :heavy_minus_sign:
update failed Accepts request, service instance is being shared with another space :white_check_mark: :heavy_minus_sign:
delete failed Accepts request, service instance is being shared with another space :white_check_mark: :heavy_minus_sign:
delete in progress Accepts request, service instance is being shared with another space delete in progress error msg #2739 :white_check_mark:

GET /v3/service_instances/:guid/parameters for already existing service-instance

Resource State Observed Behaviour Wanted Behaviour PR Fixed in main
none (synchronous case) :question: :heavy_minus_sign:
create succeeded accepts request :white_check_mark: :heavy_minus_sign:
create in progress rejects request (1) :white_check_mark: :heavy_minus_sign:
create failed accepts request returns an error (not exists) #2750 :white_check_mark:
update succeeded accepts request :white_check_mark: :heavy_minus_sign:
update in progress rejects request (1) :white_check_mark: :heavy_minus_sign:
update failed accepts request :white_check_mark: :heavy_minus_sign:
delete failed accepts request :white_check_mark: :heavy_minus_sign:
delete in progress rejects request (1) :white_check_mark: :heavy_minus_sign:
philippthun commented 2 years ago

Everything done :tada: