Merge pull request #5944 from heyitsanthony/mvcc-failpoints

build, backend: add backend commit failpoints
release-3.1
Anthony Romano 2016-07-14 13:08:25 -07:00 committed by GitHub
commit 575682f593
2 changed files with 3 additions and 1 deletions

2
build
View File

@ -12,7 +12,7 @@ fi
# enable/disable failpoints
toggle_failpoints() {
FAILPKGS="etcdserver/"
FAILPKGS="etcdserver/ mvcc/backend/"
mode="disable"
if [ ! -z "$FAILPOINTS" ]; then mode="enable"; fi

View File

@ -166,7 +166,9 @@ func (t *batchTx) commit(stop bool) {
return
}
start := time.Now()
// gofail: var beforeCommit struct{}
err = t.tx.Commit()
// gofail: var afterCommit struct{}
commitDurations.Observe(time.Since(start).Seconds())
atomic.AddInt64(&t.backend.commits, 1)