-
Notifications
You must be signed in to change notification settings - Fork 385
Duplicate OSB create/delete requests #1639
Comments
This conflict is a "normal" situation for Kubernetes-style APIs with eventual consistency and idempotency, but it could be a problem for OSB brokers who don't necessarily guarantee the idempotency semantics. |
My guess is that the problem is that we pick up the events from the queue "too early" without giving enough time to receive the latest version of the instance we just updated processing a previous event:
|
The naive solution for this problem I see is to add an artificial delay in between processing events of a single We can use a It will mean that there will be an artificial pause between making a change in the If there are no other suggestions, I can give it a try. |
After changing the code to
(adding a delay of 3 seconds for adding
so it seems to work? If we consider this a valid fix, I can send a PR to make this change in all our controller queues. |
The |
@staebler I agree that the cause of the issue is the same, but it wasn't mentioned that this behavior leads to duplicate OSB requests. As I mentioned above, it's probably okay to have duplicate processing within Kubernetes world, but OSB spec doesn't guarantee idempotency so the provisioning/deprovisioning could break because of that. |
@nilebox The OSB spec does guarantee idempotency. For example, if the same provision request is made again after the first one is successful, the spec states that the broker must respond with a 200 OK. That is why there has not been a greater push to resolve this issue in service catalog. |
@staebler OSB doesn't guarantee a deterministic behaviour on concurrent requests though. If Service Catalog issues a duplicate request while initial request is still in progress, it might lead to either 200 or 422, if I understand correctly. See https://github.com/openservicebrokerapi/servicebroker/blob/master/spec.md#blocking-operations But I personally agree that brokers should be idempotent. |
…tance object This prevents multiple provision requests from being sent to the broker and posting old resource versions to the API server. Fixes kubernetes-retired#1639 and kubernetes-retired#1363
…tance object This prevents multiple provision requests from being sent to the broker and posting old resource versions to the API server. Fixes kubernetes-retired#1639 and kubernetes-retired#1363
…es-retired#1779) * Simplify generateChecksumOfParameters() in tests * Make the reconciliation loop exit after each update of the ServiceInstance object This prevents multiple provision requests from being sent to the broker and posting old resource versions to the API server. Fixes kubernetes-retired#1639 and kubernetes-retired#1363 * Make resolveReferences return true only when an error didn't occur * Remove unnecessary var * Don't return the updatedInstance in controller.resolveReferences() * Improve name of test helper function * Exit the reconciliation loop iteration after each update when handling ServiceInstance update and deprovision calls
I've noticed duplicate OSB requests for a single change in
ServiceInstance
in different scenarios:ups-broker
):By looking at the Service Catalog logs, it seems that there is an issue with picking up a stale object from the queue (before it is synchronized with the latest version from etcd) which leads to duplicate processing:
The text was updated successfully, but these errors were encountered: