-
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
Allow schema updates to reserved preds if the update is the same. #3143
Conversation
Outright rejecting a schema update if it is for a reserved predicate has caused some issues (in ratel and jepsen for example). Make the check more robust by allowing the updates to go through if the update to a reserved predicate is the same as a existing one.
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 3 files reviewed, 1 unresolved discussion (waiting on @martinmr)
schema/schema.go, line 475 at r1 (raw file):
return true } return true
Consider this return here when the provided pred is not a reserved predicate,
maybe we can change this function to be IsReservedPredicateAndChanged,
then this return should be change false, and we don't need to call the x.IsReservedPredicate in the caller.
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 3 files reviewed, 1 unresolved discussion (waiting on @gitlw)
schema/schema.go, line 475 at r1 (raw file):
Previously, gitlw (Lucas Wang) wrote…
Consider this return here when the provided pred is not a reserved predicate,
maybe we can change this function to be IsReservedPredicateAndChanged,
then this return should be change false, and we don't need to call the x.IsReservedPredicate in the caller.
Done. I let the name unchanged but merged the checks into the same method.
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 3 files reviewed, 1 unresolved discussion (waiting on @gitlw)
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.
Reviewed 1 of 3 files at r1, 2 of 2 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @gitlw and @martinmr)
schema/schema.go, line 475 at r2 (raw file):
continue } if proto.Equal(original, update) {
return !proto.Equal(...)
…graph-io/dgraph into martinmr/allow-unchanged-reserved-pred
…raph-io#3143) Outright rejecting a schema update if it is for a reserved predicate has caused some issues (in ratel and jepsen for example). Make the check more robust by allowing the updates to go through if the update to a reserved predicate is the same as a existing one.
Outright rejecting a schema update if it is for a reserved predicate has
caused some issues (in ratel and jepsen for example). Make the check
more robust by allowing the updates to go through if the update to a
reserved predicate is the same as a existing one.
This change is