Skip to content

Commit a9a08f6

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

File tree

1 file changed

+47
-40
lines changed

1 file changed

+47
-40
lines changed

spec.md

Lines changed: 47 additions & 40 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

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

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.
707+
This error response MUST not cause orphan mitigation to be initiated (see the
708+
[Orphan Mitigation](#orphan-mitigation) section). Therefore, Platforms receiving
709+
this error response SHOULD resend the request at a later time.
709710

710711
Brokers MAY choose to treat the creation of a Service Binding as a mutation of
711712
the corresponding Service Instance - it is an implementation choice. Doing so
@@ -779,11 +780,10 @@ For success responses, the following fields are defined:
779780
}
780781
```
781782

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.
783+
For asynchronous provision operations, if the response contains
784+
`"state": "failed"`, then the Platform MAY need to send a deprovision request to
785+
the Service Broker to prevent an orphan being created (see the
786+
[Orphan Mitigation](#orphan-mitigation) section).
787787

788788
## Polling Last Operation for Service Bindings
789789

@@ -857,9 +857,9 @@ For success responses, the following fields are defined:
857857
}
858858
```
859859

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.
860+
If the response contains `"state": "failed"`, then the Platform MAY need to send
861+
an unbind request to the Service Broker to prevent an orphan being created (see
862+
the [Orphan Mitigation](#orphan-mitigation) section).
863863

864864
## Polling Interval and Duration
865865

@@ -949,11 +949,10 @@ $ curl http://username:password@service-broker-url/v2/service_instances/:instanc
949949
| 409 Conflict | MUST be returned if a Service Instance with the same id already exists but with different attributes. |
950950
| 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."`. |
951951

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.
952+
Responses with any other status code MUST be interpreted as a failure. If a
953+
failure occurs, then the Platform MAY need to send a deprovision request to the
954+
Service Broker to prevent an orphan being created (see the
955+
[Orphan Mitigation](#orphan-mitigation) section).
957956

958957
#### Body
959958

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

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.
1343+
Responses with any other status code MUST be interpreted as a failure. If a
1344+
failure occurs, then the Platform MAY need to send an unbind request to the
1345+
Service Broker to prevent an orphan being created (see the
1346+
[Orphan Mitigation](#orphan-mitigation) section).
13491347

13501348
#### Body
13511349

@@ -1616,40 +1614,49 @@ For success responses, the following fields are defined:
16161614
}
16171615
```
16181616

1619-
## Orphans
1617+
## Orphan Mitigation
16201618

16211619
The Platform is the source of truth for Service Instances and Service Bindings.
16221620
Service Brokers are expected to have successfully provisioned all of the Service
16231621
Instances and Service Bindings that the Platform knows about, and none that it
16241622
doesn't.
16251623

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.
1624+
Orphaned Service Instances and Service Bindings MAY be created by in any of the
1625+
following scenarios:
1626+
* The Service Broker does not return a response before a request from the
1627+
Platform times out (typically 60 seconds). The Service Broker might eventually
1628+
succeed in creating a resource, however the Platform MAY have already considered
1629+
the request a failure.
1630+
* A synchronous [Provisioning](#provisioning) request fails.
1631+
* A call to the
1632+
[Polling Last Operation for Service Instances](#polling-last-operation-for-service-instances)
1633+
endpoint returns `"state": "failed"` for an asynchronous provisioning request
1634+
* A synchronous [Binding](#binding]) request fails
1635+
* A call to the
1636+
[Polling Last Operation for Service Bindings](#polling-last-operation-for-service-bindings)
1637+
endpoint returns `"state": "failed"` for an asynchronous binding request
1638+
* The Platform encounters an internal error creating a Service Instance or
1639+
Service Binding (for example, saving to the database fails).
16321640

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

16381649
Platforms SHOULD initiate orphan mitigation in the following scenarios:
16391650

16401651
| Status Code Of Service Broker Response | Platform Interpretation Of Response | Platform Initiates Orphan Mitigation? |
16411652
| --- | --- | --- |
16421653
| 200 | Success | No |
16431654
| 200 with malformed response | Failure | No |
1655+
| 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 |
16441656
| 201 | Success | No |
16451657
| 201 with malformed response | Failure | Yes |
16461658
| All other 2xx | Failure | Yes |
16471659
| 408 | Client timeout failure (request not received at the server) | No |
16481660
| All other 4xx | Request rejected | No |
16491661
| 5xx | Service Broker error | Yes |
16501662
| 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)