Use txn writer to write schema postings#4296
Conversation
martinmr
left a comment
There was a problem hiding this comment.
Just a small comment but otherwise it
Reviewed 1 of 1 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @animesh2049, @ashish-goswami, @mangalaman93, and @manishrjain)
dgraph/cmd/bulk/schema.go, line 146 at r1 (raw file):
func (s *schemaStore) write(db *badger.DB, preds []string) { // Write schema always at timestamp 1, s.state.writeTs may not be equal to 1
I'd move this comment right above the line where the schema is actually being written.
Also, change the comment to say "Write schema and types".
ashish-goswami
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @animesh2049, @mangalaman93, @manishrjain, and @martinmr)
dgraph/cmd/bulk/schema.go, line 146 at r1 (raw file):
Previously, martinmr (Martin Martinez Rivera) wrote…
I'd move this comment right above the line where the schema is actually being written.
Also, change the comment to say "Write schema and types".
Done.
mangalaman93
left a comment
There was a problem hiding this comment.
Generally looks good, we should add a test that verifies this. We can change the name of the test such that it doesn't run by the CI.
Reviewed 1 of 1 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @animesh2049, @manishrjain, and @martinmr)
manishrjain
left a comment
There was a problem hiding this comment.
Reviewed 1 of 1 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @animesh2049 and @martinmr)
Fixes #3916
Although I was not able to reproduce this. Stacktrace suggests, while writing schema to Badger, it got crashed with error:
Txn is too big to fit into one request. This might be because, we are using single transaction to write schema for all predicates.This PR, replaces single transaction with TxnWriter to write schema.
This change is