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

fix(dgraph): Do not return reverse edges from expandEdges #7461

Merged
merged 4 commits into from
Feb 22, 2021

Conversation

jarifibrahim
Copy link
Contributor

@jarifibrahim jarifibrahim commented Feb 19, 2021

We don't need to return reverse edges when we expand the types.
When alpha is running in strict mutations mode and if we try to
delete a node with a type that contains a reverse edge then that
could cause the deletion to fail because the type would be expanded
with the reverse edges.

With this PR, we don't process the reverse edges when processing a type.
Fixes DGRAPH-3057


This change is Reviewable

Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

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

:lgtm: Also get someone to create tests for this change. We need two. 1. We shouldn't accept reverse edge mutations. and 2. We should not auto-expand a reverse edge if type has it.

Reviewable status: 0 of 2 files reviewed, all discussions resolved (waiting on @pawanrawal and @vvbalaji-dgraph)

Copy link
Contributor

@danielmai danielmai left a comment

Choose a reason for hiding this comment

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

Does this change apply only to set/delete mutations or from queries using expand(_all_) as well?

Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @pawanrawal and @vvbalaji-dgraph)

Copy link
Contributor Author

@jarifibrahim jarifibrahim left a comment

Choose a reason for hiding this comment

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

Does this change apply only to set/delete mutations or from queries using expand(all) as well?

We removed the restriction we had earlier. This PR now ony removes the reverse edges while expanding edges (this works with expand(all). I verified this along with @pawanrawal )

Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @pawanrawal and @vvbalaji-dgraph)

@jarifibrahim jarifibrahim merged commit 03e7a1d into master Feb 22, 2021
@jarifibrahim jarifibrahim deleted the ibrahim/strictmutation-reverse-fix branch February 22, 2021 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants