-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fix too many relationship error #5541
Conversation
CodSpeed Performance ReportMerging #5541 will not alter performanceComparing Summary
|
eaa8f89
to
ef1adef
Compare
# having the same parent, with the parent having another extra relationship. Concurrent coroutines will try to | ||
# add this relationship to this object, and the second one will fail. See https://github.com/opsmill/infrahub/issues/5474. | ||
# Note it also prevents extra relationships fetching. Ideally, DataLoader would fetch all needed data only once | ||
# and exporting node to graphql would then not mutate this object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional thoughts regarding why ip_namespace
relationships of parent prefix is not used from DataLoader
in below test, based on debugging/discussion with @ajtmccarty. I am not 100% sure but I believe it makes sense:
DataLoader
correctly loads prefix 10.0.0.0/8, but when we resolve parent of 10.0.0.0/16 (ie, 10.0.0.0/8),node_fields
appear to be different between first call to_get_entities_with_data_loader
for 10.0.0.0/8 and second call to resolve parent of 10.0.0.0/16 (ie, 10.0.0.0/8). Thus we do not match existingDataLoader
and cannot retrieve existing node already havingip_namespace
fetched.- Now, if we had queried only 10.0.0.0/16 and 10.0.0.1/16, 10.0.0.0/8 would have been retrieved only while resolving parent of these nodes. However, graphql query does not ask for parent
ip_namespace
relationship so it's not retrieved byDataLoader
, but it does ask for hfid which relies onip_namespace
and then we fetch it afterDataLoader
step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update as per @ajtmccarty slack comment, ip_namespace
is probably not retrieved correctly because we resolve parent with kind BuiltinIPPrefix
for which hfid
does not contain ip_namespace
, instead of InfraPrefix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, it was a tough one
please can you add a news fragment to include something in the release note
Fixes #5474, #5475