Merge pull request #10193 from johncming/master

mvcc/backend: code format optimization
This commit is contained in:
Xiang Li 2018-10-22 11:50:53 -07:00 committed by GitHub
commit a27a73e448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -399,14 +399,7 @@ func (b *backend) defrag() error {
plog.Panicf("cannot open database at %s (%v)", dbp, err)
}
}
b.batchTx.tx, err = b.db.Begin(true)
if err != nil {
if b.lg != nil {
b.lg.Fatal("failed to begin tx", zap.Error(err))
} else {
plog.Fatalf("cannot begin tx (%s)", err)
}
}
b.batchTx.tx = b.unsafeBegin(true)
b.readTx.reset()
b.readTx.tx = b.unsafeBegin(false)