Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADCM-1366 MultipleObjectsReturned on GET hc #479

Merged
merged 3 commits into from
Jul 31, 2020
Merged

ADCM-1366 MultipleObjectsReturned on GET hc #479

merged 3 commits into from
Jul 31, 2020

Conversation

acmnu
Copy link
Member

@acmnu acmnu commented Jul 17, 2020

There is a trouble with read operation of HC in cluster.
That is an issue in ADCM-733 solution.

In case we have more than one prototype of service with the
same name in DB we have a trouble with searching exact component.
There is no restriction per bundle. So we have MultipleObj
exception on objects.get() operation.

Solution is to restrict service prototypes to exactly one bundle.

That solution is not simple because we have no good ORM way to find
result over FK. We have to use SQL in operation, which not so offen in
use in our code.

@acmnu acmnu requested a review from grey-kristy July 17, 2020 14:52
comp = Component.objects.get(
name=c['component'],
prototype__name=c['service'],
prototype__in=sp_qs # There is no way to do this without 'in'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be
prototype__bundle_id=obj.prototypype.bundle_id

@acmnu acmnu force-pushed the ADCM-1366 branch 2 times, most recently from e28b764 to 51a78f3 Compare July 23, 2020 08:01
There is a trouble with read operation of HC in cluster.
That is an issue in ADCM-733 solution.

In case we have more than one prototype of service with the
same name in DB we have a trouble with searching exact component.
There is no restriction per bundle. So we have MultipleObj
exception on objects.get() operation.

Solution is to restrict service prototypes to exactly one bundle.
@acmnu acmnu requested a review from grey-kristy July 30, 2020 07:15
@acmnu acmnu merged commit cc67f3b into develop Jul 31, 2020
@acmnu acmnu deleted the ADCM-1366 branch August 5, 2020 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants