Skip to content

Commit

Permalink
fix ErrIndexingInProgress if schema update fails (#6583)
Browse files Browse the repository at this point in the history
Fixes DGRAPH-2370

If index building fails for some reason after starting building indexes, no new schema mutations
can take place. It throws out errIndexingInProgress error. This is because though the schema
update has failed, the predicate remains in the mutSchema. It should be deleted from the map.
  • Loading branch information
NamanJain8 authored Sep 28, 2020
1 parent e496467 commit 1c7429d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ func Load(predicate string) error {
if len(predicate) == 0 {
return errors.Errorf("Empty predicate")
}
delete(State().mutSchema, predicate)
key := x.SchemaKey(predicate)
txn := pstore.NewTransactionAt(1, false)
defer txn.Discard()
Expand All @@ -448,7 +449,6 @@ func Load(predicate string) error {
}
State().Set(predicate, &s)
State().elog.Printf(logUpdate(&s, predicate))
delete(State().mutSchema, predicate)
glog.Infoln(logUpdate(&s, predicate))
return nil
}
Expand Down

0 comments on commit 1c7429d

Please sign in to comment.