We commit schema to disk in blocking way, should be ok because this happens only during schema mutations or we see a new predicate.
(typeName string, t *pb.TypeUpdate, ts uint64)
| 337 | // We commit schema to disk in blocking way, should be ok because this happens |
| 338 | // only during schema mutations or we see a new predicate. |
| 339 | func updateType(typeName string, t *pb.TypeUpdate, ts uint64) error { |
| 340 | schema.State().SetType(typeName, t) |
| 341 | txn := pstore.NewTransactionAt(ts, true) |
| 342 | defer txn.Discard() |
| 343 | data, err := proto.Marshal(t) |
| 344 | x.Check(err) |
| 345 | e := &badger.Entry{ |
| 346 | Key: x.TypeKey(typeName), |
| 347 | Value: data, |
| 348 | UserMeta: posting.BitSchemaPosting, |
| 349 | } |
| 350 | if err := txn.SetEntry(e.WithDiscard()); err != nil { |
| 351 | return err |
| 352 | } |
| 353 | return txn.CommitAt(ts, nil) |
| 354 | } |
| 355 | |
| 356 | func hasEdges(attr string, startTs uint64) bool { |
| 357 | pk := x.ParsedKey{Attr: attr} |
no test coverage detected
searching dependent graphs…