Restore service binding ordering in sys env presenter - #4665
Merged
Conversation
The ordering of multiple service bindings for the same service with VCAP service has changed. They are now sorted by service instance guid and not service binding id. This was implicit behaviour. While clients should be inspecting the binding object itslef and not relying on the index, unfortunately not all clients do that. This appears to have been introduced as part of this commit to support binding rotation 79b4da3#diff-403a1ff3052c3335b1d4f0db3569c895bf7ba4ca01539c562d009394c907d64bR148 and this migration f011651 and I believe the introduction of the index: ``` add_index %i[app_guid service_instance_guid], name: :service_bindings_app_guid_service_instance_guid_index ``` Means that the query to obtain the binding list now uses this index, and it uses the natural order of that index, which is by service_instance_guid rather than previously which would have been the natural order by id. This change restores the previous behaviour by explicitly specifying the ordering.
Samze
force-pushed
the
restore_binding_order
branch
from
November 19, 2025 18:59
5326f16 to
78b68cd
Compare
Samze
requested review from
johha,
philippthun and
sethboyles
and removed request for
johha
November 19, 2025 20:25
5 tasks
sethboyles
approved these changes
Nov 19, 2025
PeteLevineA
approved these changes
Nov 19, 2025
philippthun
approved these changes
Nov 19, 2025
philippthun
left a comment
Member
There was a problem hiding this comment.
Interesting finding. It might be a combination of the new index (app_guid + service_instance_guid) and the window function that groups by service_instance_guid - that's what ChatGPT explained to me and it sounds reasonable.
ari-wg-gitbot
added a commit
to cloudfoundry/capi-release
that referenced
this pull request
Nov 19, 2025
Changes in cloud_controller_ng:
- Restore service binding ordering in sys env presenter
PR: cloudfoundry/cloud_controller_ng#4665
Author: Sam Gunaratne <385176+Samze@users.noreply.github.com>
sethboyles
pushed a commit
to atanas-attodorov-wq/cloud_controller_ng
that referenced
this pull request
Dec 11, 2025
) The ordering of multiple service bindings for the same service with VCAP service has changed. They are now sorted by service instance guid and not service binding id. This was implicit behaviour. While clients should be inspecting the binding object itslef and not relying on the index, unfortunately not all clients do that. This appears to have been introduced as part of this commit to support binding rotation cloudfoundry@79b4da3#diff-403a1ff3052c3335b1d4f0db3569c895bf7ba4ca01539c562d009394c907d64bR148 and this migration cloudfoundry@f011651 and I believe the introduction of the index: ``` add_index %i[app_guid service_instance_guid], name: :service_bindings_app_guid_service_instance_guid_index ``` Means that the query to obtain the binding list now uses this index, and it uses the natural order of that index, which is by service_instance_guid rather than previously which would have been the natural order by id. This change restores the previous behaviour by explicitly specifying the ordering.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ordering of multiple service bindings for the same service with VCAP service has changed. They are now sorted by service instance guid and not service binding id. This was implicit behaviour.
While clients should be inspecting the binding
object itslef and not relying on the index, unfortunately not all clients do that.
This appears to have been introduced as part of this commit to support binding rotation 79b4da3 and this migration f011651 which contains:
I believe the introduction of the index means that the query to obtain the binding list now uses this index, and it uses the order of that index, which is by service_instance_guid rather than previously which would have been the natural order by id.
This change restores the previous behaviour by explicitly specifying the ordering.
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
mainbranchI have run all the unit tests using
bundle exec rakeI have run CF Acceptance Tests