Support WriteBatch API in managed mode#948
Conversation
1bd48bb to
e68bd8f
Compare
ashish-goswami
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 6 files reviewed, 1 unresolved discussion (waiting on @ashish-goswami, @jarifibrahim, and @manishrjain)
batch.go, line 51 at r1 (raw file):
// NewWriteBatchAt is similar to NewWriteBatch but it allows user to set the commit timestamp. // NewWriteBatchAt is supposed to be used in the managed mode. func (db *DB) NewWriteBatchAt(commitTs uint64) (*WriteBatch, error) {
should we move function to managed_db.go?
manishrjain
left a comment
There was a problem hiding this comment.
Don't return error. And avoid making other changes.
Reviewed 6 of 6 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @jarifibrahim)
batch.go, line 44 at r1 (raw file):
if db.opt.managedTxns { return nil, errors.New("cannot use NewWriteBatch in managed mode. Use NewWriteBatchAt instead")
Make it panic. No need for error. So, don't change any existing APIs.
batch.go, line 54 at r1 (raw file):
if !db.opt.managedTxns { return nil, errors.New( "cannot use NewWriteBatchAt with managedDB=false. Use NewTransaction instead")
Make this panic as well.
jarifibrahim
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 3 files reviewed, 3 unresolved discussions (waiting on @ashish-goswami and @manishrjain)
batch.go, line 44 at r1 (raw file):
Previously, manishrjain (Manish R Jain) wrote…
Make it panic. No need for error. So, don't change any existing APIs.
Done.
batch.go, line 51 at r1 (raw file):
Previously, ashish-goswami (Ashish Goswami) wrote…
should we move function to managed_db.go?
Moved to managed_db.go
batch.go, line 54 at r1 (raw file):
Previously, manishrjain (Manish R Jain) wrote…
Make this panic as well.
Done.
This commit adds a new `WriteBatchAt(commitTs)` API which allows the user to use write batch in managed mode. Fixes #944
This PR adds a new
WriteBatchAt(commitTs)API which allows user to use write batch in managed mode.Fixes #944
This change is