build, backend: add backend commit failpoints

release-3.1
Anthony Romano 2016-07-04 00:26:30 -07:00
parent 35d379b052
commit ba2725c2d0
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)