Skip to content

Commit

Permalink
*: add base meta structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
siddontang committed Oct 20, 2015
1 parent 4eb4c29 commit ba475f8
Show file tree
Hide file tree
Showing 3 changed files with 460 additions and 7 deletions.
8 changes: 4 additions & 4 deletions kv/txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"github.com/pingcap/tidb/util/errors2"
)

// isRetryableError checks if the err is a fatal error and the under going operation is worth to retry.
func isRetryableError(err error) bool {
// IsRetryableError checks if the err is a fatal error and the under going operation is worth to retry.
func IsRetryableError(err error) bool {
if err == nil {
return false
}
Expand All @@ -42,7 +42,7 @@ func RunInNewTxn(store Storage, retryable bool, f func(txn Transaction) error) e
}

err = f(txn)
if retryable && isRetryableError(err) {
if retryable && IsRetryableError(err) {
log.Warnf("Retry txn %v", txn)
txn.Rollback()
continue
Expand All @@ -52,7 +52,7 @@ func RunInNewTxn(store Storage, retryable bool, f func(txn Transaction) error) e
}

err = txn.Commit()
if retryable && isRetryableError(err) {
if retryable && IsRetryableError(err) {
log.Warnf("Retry txn %v", txn)
txn.Rollback()
continue
Expand Down
Loading

0 comments on commit ba475f8

Please sign in to comment.