Skip to content

Commit d36b136

Browse files
author
Matt McNeeney
committed
Rework orphan mitigation section
1 parent b7e21c9 commit d36b136

File tree

1 file changed

+66
-54
lines changed

1 file changed

+66
-54
lines changed

spec.md

Lines changed: 66 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
- [Fetching a Service Binding](#fetching-a-service-binding)
3030
- [Unbinding](#unbinding)
3131
- [Deprovisioning](#deprovisioning)
32-
- [Orphans](#orphans)
32+
- [Orphan Mitigation](#orphan-mitigation)
3333

3434
## API Overview
3535

@@ -250,10 +250,11 @@ Where the `value`, when decoded, is:
250250
```
251251

252252
Note that not all messages sent to a Service Broker are initiated by an
253-
end-user of the Platform. For example, during orphan mitigation or during the
254-
querying of the Service Broker's catalog, the Platform might not have an
255-
end-user with which to associate the request, therefore in those cases the
256-
originating identity header would not be included in those messages.
253+
end-user of the Platform. For example, during
254+
[Orphan Mitigation](#orphan-mitigation) or during the querying of the Service
255+
Broker's catalog, the Platform might not have an end-user with which to
256+
associate the request, therefore in those cases the originating identity header
257+
would not be included in those messages.
257258

258259
## Vendor Extension Fields
259260

@@ -704,9 +705,8 @@ containing error code `"ConcurrencyError"` (see
704705
a helpful error message in the `description` field such as `"Another operation
705706
for this Service Instance is in progress."`.
706707

707-
Note that per the [Orphans](#orphans) section, this error response does not
708-
cause orphan mitigation to be initiated. Therefore, Platforms receiving this
709-
error response SHOULD resend the request at a later time.
708+
Upon receiving this error response, Platforms MUST NOT perform
709+
[Orphan Mitigation](#orphan-mitigation).
710710

711711
Brokers MAY choose to treat the creation of a Service Binding as a mutation of
712712
the corresponding Service Instance - it is an implementation choice. Doing so
@@ -780,11 +780,9 @@ For success responses, the following fields are defined:
780780
}
781781
```
782782

783-
If the response contains `"state": "failed"` then the Platform MUST send a
784-
deprovision request to the Service Broker to prevent an orphan being created on
785-
the Service Broker. However, while the Platform will attempt
786-
to send a deprovision request, Service Brokers MAY automatically delete
787-
any resources associated with the failed provisioning request on their own.
783+
For asynchronous provision operations, if the response contains
784+
`"state": "failed"` then the Platform might need to perform
785+
[Orphan Mitigation](#orphan-mitigation).
788786

789787
## Polling Last Operation for Service Bindings
790788

@@ -858,9 +856,8 @@ For success responses, the following fields are defined:
858856
}
859857
```
860858

861-
If the response contains `"state": "failed"` then the Platform MUST send an
862-
unbind request to the Service Broker to prevent an orphan being created on
863-
the Service Broker.
859+
If the response contains `"state": "failed"`, then the Platform might need to
860+
perform [Orphan Mitigation](#orphan-mitigation).
864861

865862
## Polling Interval and Duration
866863

@@ -950,11 +947,8 @@ $ curl http://username:password@service-broker-url/v2/service_instances/:instanc
950947
| 409 Conflict | MUST be returned if a Service Instance with the same id already exists but with different attributes. |
951948
| 422 Unprocessable Entity | MUST be returned if the Service Broker only supports asynchronous provisioning for the requested Service Plan and the request did not include `?accepts_incomplete=true`. The response body MUST contain error code `"AsyncRequired"` (see [Service Broker Errors](#service-broker-errors)). The error response MAY include a helpful error message in the `description` field such as `"This Service Plan requires client support for asynchronous service operations."`. |
952949

953-
Responses with any other status code MUST be interpreted as a failure. See
954-
the [Orphans](#orphans) section for more information related to whether
955-
orphan mitigation needs to be applied. While a Platform might attempt
956-
to send a deprovision request, Service Brokers MAY automatically delete
957-
any resources associated with the failed provisioning request on their own.
950+
Responses with any other status code MUST be interpreted as a failure and the
951+
Platform might need to perform [Orphan Mitigation](#orphan-mitigation).
958952

959953
#### Body
960954

@@ -1342,11 +1336,8 @@ $ curl http://username:password@service-broker-url/v2/service_instances/:instanc
13421336
| 409 Conflict | MUST be returned if a Service Binding with the same id, for the same Service Instance, already exists but with different parameters. |
13431337
| 422 Unprocessable Entity | MUST be returned if the Service Broker requires that `app_guid` be included in the request body. The response body MUST contain error code `"RequiresApp"` (see [Service Broker Errors](#service-broker-errors)). The error response MAY include a helpful error message in the `description` field such as `"This Service supports generation of credentials through binding an application only."`. Additionally, if the Service Broker rejects the request due to a concurrent request to create a Service Binding for the same Service Instance, then this error MUST be returned (see [Blocking Operations](#blocking-operations)). This MUST also be returned if the Service Broker only supports asynchronous bindings for the Service Instance and the request did not include `?accepts_incomplete=true`. In this case, the response body MUST contain error code `"AsyncRequired"` (see [Service Broker Errors](#service-broker-errors)). The error response MAY include a helpful error message in the `description` field such as `"This Service Instance requires client support for asynchronous binding operations."`. |
13441338

1345-
Responses with any other status code MUST be interpreted as a failure and an
1346-
unbind request MUST be sent to the Service Broker to prevent an orphan being
1347-
created on the Service Broker. However, while the platform will attempt
1348-
to send an unbind request, Service Brokers MAY automatically delete
1349-
any resources associated with the failed bind request on their own.
1339+
Responses with any other status code MUST be interpreted as a failure and the
1340+
Platform might need to perform [Orphan Mitigation](#orphan-mitigation).
13501341

13511342
#### Body
13521343

@@ -1633,40 +1624,61 @@ For success responses, the following fields are defined:
16331624
}
16341625
```
16351626

1636-
## Orphans
1627+
## Orphan Mitigation
16371628

16381629
The Platform is the source of truth for Service Instances and Service Bindings.
16391630
Service Brokers are expected to have successfully provisioned all of the Service
16401631
Instances and Service Bindings that the Platform knows about, and none that it
16411632
doesn't.
16421633

1643-
Orphans can result if the Service Broker does not return a response before a
1644-
request from the Platform times out (typically 60 seconds). For example, if a
1645-
Service Broker does not return a response to a provision request before the
1646-
request times out, the Service Broker might eventually succeed in provisioning
1647-
a Service Instance after the Platform considers the request a failure. This
1648-
results in an orphan Service Instance on the Service Broker's side.
1634+
Orphaned Service Instances and Service Bindings might have been created in one
1635+
of the following scenarios:
1636+
* The Service Broker does not return a response before a request from the
1637+
Platform times out (typically 60 seconds). The Service Broker might eventually
1638+
succeed in creating a resource, however the Platform might have already
1639+
considered the request a failure.
1640+
* A synchronous [Provisioning](#provisioning) request fails.
1641+
* A call to the
1642+
[Polling Last Operation for Service Instances](#polling-last-operation-for-service-instances)
1643+
endpoint returns `"state": "failed"` for an asynchronous provisioning or
1644+
deprovisioning request.
1645+
* A synchronous [Binding](#binding]) request fails.
1646+
* A call to the
1647+
[Polling Last Operation for Service Bindings](#polling-last-operation-for-service-bindings)
1648+
endpoint returns `"state": "failed"` for an asynchronous binding or unbinding
1649+
request.
1650+
* The Platform encounters an internal error when creating a Service Instance or
1651+
Service Binding (for example, saving to the database fails).
16491652

1650-
To mitigate orphan Service Instances and Service Bindings, the Platform SHOULD
1653+
To mitigate orphaned Service Instances and Service Bindings, the Platform SHOULD
16511654
attempt to delete resources it cannot be sure were successfully created, and
16521655
SHOULD keep trying to delete them until the Service Broker responds with a
1653-
success.
1654-
1655-
Platforms SHOULD initiate orphan mitigation in the following scenarios:
1656-
1657-
| Status Code Of Service Broker Response | Platform Interpretation Of Response | Platform Initiates Orphan Mitigation? |
1658-
| --- | --- | --- |
1659-
| 200 | Success | No |
1660-
| 200 with malformed response | Failure | No |
1661-
| 201 | Success | No |
1662-
| 201 with malformed response | Failure | Yes |
1663-
| All other 2xx | Failure | Yes |
1664-
| 408 | Client timeout failure (request not received at the server) | No |
1665-
| All other 4xx | Request rejected | No |
1666-
| 5xx | Service Broker error | Yes |
1667-
| Timeout | Failure | Yes |
1668-
1669-
If the Platform encounters an internal error provisioning a Service Instance or
1670-
Service Binding (for example, saving to the database fails), then it MUST at
1671-
least send a single delete or unbind request to the Service Broker to prevent
1672-
the creation of an orphan.
1656+
success. Service Brokers MAY automatically delete any resources they believe to
1657+
be orphaned on their own. Note that the Platform MAY allow end users to
1658+
determine when orphan mitigation occurs, in order to allow them to investigate
1659+
the cause of any failures.
1660+
1661+
The following table aims to describe when Orphan Mitigation is to be initiated
1662+
by the Platform:
1663+
1664+
| Request | Service Broker Response Status Code | Platform Interpretation Of Response | Orphan Mitigation SHOULD be performed for Service Instances | Orphan Mitigation SHOULD be performed for Service Bindings |
1665+
| --- | --- | --- | --- | --- |
1666+
| _All_ | 200 | Success | No | No |
1667+
| _All_ | 200 with malformed response | Failure | No | No |
1668+
| [Polling Last Operation for Service Instances](#polling-last-operation-for-service-instances) for [Provisioning](#provisioning)/[Deprovisioning](#deprovisioning) | 200 with `"state": "failed"` | Failure | Yes | No |
1669+
| [Polling Last Operation for Service Bindings](#polling-last-operation-for-service-bindings) for [Binding](#binding)/[Unbinding](#unbinding) | 200 with `"state": "failed"` | Failure | No | Yes |
1670+
| _All_ | 201 | Success | No | No |
1671+
| [Provisioning](#provisioning) | 201 with malformed response | Failure | Yes | No |
1672+
| [Binding](#binding) | 201 with malformed response | Failure | No | Yes |
1673+
| _All_ | 202 | Success | No | No |
1674+
| [Provisioning](#provisioning)/[Deprovisioning](#deprovisioning) | All other 2xx | Failure | Yes | No |
1675+
| [Binding](#binding)/[Unbinding](#unbinding) | All other 2xx | Failure | No | Yes |
1676+
| [Updating a Service Instance](#updating-a-service-instance) | All other 2xx | Failure | No | No |
1677+
| _All_ | 408 | Client timeout failure (request not received at the server) | No | No |
1678+
| _All_ | All other 4xx | Request rejected | No | No |
1679+
| [Provisioning](#provisioning)/[Deprovisioning](#deprovisioning) | 5xx | Service Broker error | Yes | No |
1680+
| [Binding](#binding)/[Unbinding](#unbinding) | 5xx | Service Broker error | No | Yes |
1681+
| [Updating a Service Instance](#updating-a-service-instance) | 5xx | Service Broker error | No | No |
1682+
| [Provisioning](#provisioning) | Timeout | Failure | Yes | No |
1683+
| [Binding](#binding) | Timeout | Failure | No | Yes |
1684+
| _All_ (excpept [Provisioning](#provisioning) and [Binding](#binding)) | Timeout | Failure | No | No |

0 commit comments

Comments
 (0)