-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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(query): Prevent multiple entries for same predicate in mutations. #7715
Conversation
Fixes DGRAPH-3225
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.
Awesome @rohanprasad. I would want similar check for types as well.
<name>: string .
<age>: int .
type <Person> {
name
}
type <Person> {
age
}
The above schema update should also complain. Currently we accept this schema.
Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @pawanrawal)
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @pawanrawal and @rohanprasad)
query/mutation.go, line 39 at r1 (raw file):
// isValidSchemaChange check if the mutation has valid schema changes. In case the mutation // has multiple entries for the same predicate we error out. func isValidSchemaChange(m *pb.Mutations) error {
Looks good. Just a comment.
Most of the cases for schema update are handled in parseSchemaFromAlterOperation
. I think it would be better to make these checks there.
Done |
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @manishrjain, @NamanJain8, @pawanrawal, and @vvbalaji-dgraph)
…a mutations. (#7715) * fix(query): Prevent multiple entries for the same predicate/type in mutations. Fixes DGRAPH-3225
…a mutations. (#7715) * fix(query): Prevent multiple entries for the same predicate/type in mutations. Fixes DGRAPH-3225
…a mutations. (#7715) * fix(query): Prevent multiple entries for the same predicate/type in mutations. Fixes DGRAPH-3225
Multiple entries for the same predicate can lead to inconsistent state, hence adding an error for it instead.
Fixes DGRAPH-3225
This change is