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

Allow schema updates to reserved preds if the update is the same. #3143

Merged
merged 5 commits into from
Mar 15, 2019

Conversation

martinmr
Copy link
Contributor

@martinmr martinmr commented Mar 15, 2019

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 Reviewable

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.
@martinmr martinmr requested a review from a team March 15, 2019 18:52
Copy link

@gitlw gitlw left a 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.

Copy link
Contributor Author

@martinmr martinmr left a 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.

Copy link

@gitlw gitlw left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @gitlw)

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: One comment.

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(...)

@martinmr martinmr merged commit 207e134 into master Mar 15, 2019
@martinmr martinmr deleted the martinmr/allow-unchanged-reserved-pred branch March 15, 2019 23:23
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
…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.
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