-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support WriteBatch API in managed mode #948
Conversation
1bd48bb
to
e68bd8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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