diff --git a/kv/txn.go b/kv/txn.go index 197a6fc5c5..18515380bf 100644 --- a/kv/txn.go +++ b/kv/txn.go @@ -38,6 +38,7 @@ func RunInNewTxn(store Storage, retryable bool, f func(txn Transaction) error) e continue } if err != nil { + txn.Rollback() return errors.Trace(err) }