Skip to content

Commit a7dd9ad

Browse files
author
Matt McNeeney
committed
Rework orphan mitigation section
1 parent 18cdf15 commit a7dd9ad

File tree

1 file changed

+42
-36
lines changed

1 file changed

+42
-36
lines changed

spec.md

Lines changed: 42 additions & 36 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

@@ -703,9 +703,9 @@ containing error code `"ConcurrencyError"` (see
703703
a helpful error message in the `description` field such as `"Another operation
704704
for this Service Instance is in progress."`.
705705

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

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

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

788787
## Polling Last Operation for Service Bindings
789788

@@ -857,9 +856,9 @@ For success responses, the following fields are defined:
857856
}
858857
```
859858

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

864863
## Polling Interval and Duration
865864

@@ -949,11 +948,10 @@ $ curl http://username:password@service-broker-url/v2/service_instances/:instanc
949948
| 409 Conflict | MUST be returned if a Service Instance with the same id already exists but with different attributes. |
950949
| 422 Unprocessable Entity | MUST be returned if the Service Broker only supports asynchronous provisioning for the requested 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."`. |
951950

952-
Responses with any other status code MUST be interpreted as a failure. See
953-
the [Orphans](#orphans) section for more information related to whether
954-
orphan mitigation needs to be applied. While a Platform might attempt
955-
to send a deprovision request, Service Brokers MAY automatically delete
956-
any resources associated with the failed provisioning request on their own.
951+
Responses with any other status code MUST be interpreted as a failure. If a
952+
failure occurs, then the Platform MAY need to send a deprovision request to the
953+
Service Broker to prevent an orphan being created (see
954+
[Orphan Mitigation](#orphan-mitigation)).
957955

958956
#### Body
959957

@@ -1341,11 +1339,10 @@ $ curl http://username:password@service-broker-url/v2/service_instances/:instanc
13411339
| 409 Conflict | MUST be returned if a Service Binding with the same id, for the same Service Instance, already exists but with different parameters. |
13421340
| 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."`. |
13431341

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

13501347
#### Body
13511348

@@ -1616,40 +1613,49 @@ For success responses, the following fields are defined:
16161613
}
16171614
```
16181615

1619-
## Orphans
1616+
## Orphan Mitigation
16201617

16211618
The Platform is the source of truth for Service Instances and Service Bindings.
16221619
Service Brokers are expected to have successfully provisioned all of the Service
16231620
Instances and Service Bindings that the Platform knows about, and none that it
16241621
doesn't.
16251622

1626-
Orphans can result if the Service Broker does not return a response before a
1627-
request from the Platform times out (typically 60 seconds). For example, if a
1628-
Service Broker does not return a response to a provision request before the
1629-
request times out, the Service Broker might eventually succeed in provisioning
1630-
a Service Instance after the Platform considers the request a failure. This
1631-
results in an orphan Service Instance on the Service Broker's side.
1623+
Orphaned Service Instances and Service Bindings MAY be created by in any of the
1624+
following scenarios:
1625+
* The Service Broker does not return a response before a request from the
1626+
Platform times out (typically 60 seconds). The Service Broker might eventually
1627+
succeed in creating a resource, however the Platform MAY have already considered
1628+
the request a failure.
1629+
* A synchronous [Provisioning](#provisioning) request fails.
1630+
* A call to the
1631+
[Polling Last Operation for Service Instances](#polling-last-operation-for-service-instances)
1632+
endpoint returns `"state": "failed"` for an asynchronous provisioning request
1633+
* A synchronous [Binding](#binding]) request fails
1634+
* A call to the
1635+
[Polling Last Operation for Service Bindings](#polling-last-operation-for-service-bindings)
1636+
endpoint returns `"state": "failed"` for an asynchronous binding request
1637+
* The Platform encounters an internal error creating a Service Instance or
1638+
Service Binding (for example, saving to the database fails).
16321639

1633-
To mitigate orphan Service Instances and Service Bindings, the Platform SHOULD
1640+
To mitigate orphaned Service Instances and Service Bindings, the Platform SHOULD
16341641
attempt to delete resources it cannot be sure were successfully created, and
16351642
SHOULD keep trying to delete them until the Service Broker responds with a
1636-
success.
1643+
success. Service Brokers MAY automatically delete any resources they believe to
1644+
be orphaned on their own. Note that the Platform MAY allow end users to
1645+
determine when orphan mitigation occurs, in order to allow end users to
1646+
investigate any failures.
16371647

16381648
Platforms SHOULD initiate orphan mitigation in the following scenarios:
16391649

16401650
| Status Code Of Service Broker Response | Platform Interpretation Of Response | Platform Initiates Orphan Mitigation? |
16411651
| --- | --- | --- |
16421652
| 200 | Success | No |
16431653
| 200 with malformed response | Failure | No |
1654+
| 200 with `"state": "failed"` (applicable to [Polling Last Operation for Service Instances](#polling-last-operation-for-service-instances) and [Polling Last Operation for Service Bindings](#polling-last-operation-for-service-bindings) endpoints) | Failure | Yes |
16441655
| 201 | Success | No |
16451656
| 201 with malformed response | Failure | Yes |
16461657
| All other 2xx | Failure | Yes |
16471658
| 408 | Client timeout failure (request not received at the server) | No |
16481659
| All other 4xx | Request rejected | No |
16491660
| 5xx | Service Broker error | Yes |
16501661
| Timeout | Failure | Yes |
1651-
1652-
If the Platform encounters an internal error provisioning a Service Instance or
1653-
Service Binding (for example, saving to the database fails), then it MUST at
1654-
least send a single delete or unbind request to the Service Broker to prevent
1655-
the creation of an orphan.

0 commit comments

Comments
 (0)