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

Restore schema states on error, and fixing flaky test #2730

Merged
merged 6 commits into from
Nov 8, 2018
Merged

Restore schema states on error, and fixing flaky test #2730

merged 6 commits into from
Nov 8, 2018

Conversation

gitlw
Copy link

@gitlw gitlw commented Nov 7, 2018

fixes #2654 fixes #2717
Tested with test.sh


This change is Reviewable

@@ -97,6 +97,8 @@ func runMutation(ctx context.Context, edge *pb.DirectedEdge, txn *posting.Txn) e
// and further mutations are blocked until this is done.
func runSchemaMutation(ctx context.Context, update *pb.SchemaUpdate, startTs uint64) error {
if err := runSchemaMutationHelper(ctx, update, startTs); err != nil {
// on error, we restore the memory state to be the same as the disk
schema.Load(update.Predicate)

Choose a reason for hiding this comment

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

Error return value of schema.Load is not checked

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 small comment.

Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @golangcibot and @gitlw)


worker/mutation.go, line 108 at r3 (raw file):

		if loadErr != nil {
			glog.Errorf("failed to load schema after %d retries: %v", maxRetries, loadErr)

glog.Fatalf

@gitlw gitlw merged commit e9d1a6b into dgraph-io:master Nov 8, 2018
@gitlw gitlw deleted the restore_schema_state_on_error branch November 8, 2018 22:41
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
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.

The test TestSystem/delete_all_reverse_index is flaky Predicate can be changed from list to scalar
3 participants