kverrors

package
v1.1.0-beta.0...-a3c9b79 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLockNotFound    = ErrRetryable("lock not found")
	ErrAlreadyRollback = ErrRetryable("already rollback")
	ErrReplaced        = ErrRetryable("replaced by another transaction")
)

ErrRetryable

Functions

This section is empty.

Types

type ErrAlreadyCommitted

type ErrAlreadyCommitted uint64

ErrAlreadyCommitted is returned specially when client tries to rollback a committed lock.

func (ErrAlreadyCommitted) Error

func (ErrAlreadyCommitted) Error() string

type ErrAssertionFailed

type ErrAssertionFailed struct {
	StartTS          uint64
	Key              []byte
	Assertion        kvrpcpb.Assertion
	ExistingStartTS  uint64
	ExistingCommitTS uint64
}

ErrAssertionFailed is returned if any assertion fails on a transaction request.

func (*ErrAssertionFailed) Error

func (e *ErrAssertionFailed) Error() string

type ErrCommitExpire

type ErrCommitExpire struct {
	StartTs     uint64
	CommitTs    uint64
	MinCommitTs uint64
	Key         []byte
}

ErrCommitExpire is returned when commit key commitTs smaller than lock.MinCommitTs

func (*ErrCommitExpire) Error

func (*ErrCommitExpire) Error() string

type ErrConflict

type ErrConflict struct {
	StartTS          uint64
	ConflictTS       uint64
	ConflictCommitTS uint64
	Key              []byte
	Reason           kvrpcpb.WriteConflict_Reason
}

ErrConflict is the error when the commit meets an write conflict error.

func (*ErrConflict) Error

func (*ErrConflict) Error() string

type ErrDeadlock

type ErrDeadlock struct {
	LockKey         []byte
	LockTS          uint64
	DeadlockKeyHash uint64
	WaitChain       []*deadlockpb.WaitForEntry
}

ErrDeadlock is returned when deadlock is detected.

func (ErrDeadlock) Error

func (ErrDeadlock) Error() string

type ErrInvalidOp

type ErrInvalidOp struct {
	Op kvrpcpb.Op
}

ErrInvalidOp is returned when an operation cannot be completed.

func (ErrInvalidOp) Error

func (e ErrInvalidOp) Error() string

type ErrKeyAlreadyExists

type ErrKeyAlreadyExists struct {
	Key []byte
}

ErrKeyAlreadyExists is returned when a key already exists.

func (ErrKeyAlreadyExists) Error

func (ErrKeyAlreadyExists) Error() string

type ErrLocked

type ErrLocked struct {
	Key  []byte
	Lock *mvcc.Lock
}

ErrLocked is returned when trying to Read/Write on a locked key. Client should backoff or cleanup the lock then retry.

func BuildLockErr

func BuildLockErr(key []byte, lock *mvcc.Lock) *ErrLocked

BuildLockErr generates ErrKeyLocked objects

func (*ErrLocked) Error

func (e *ErrLocked) Error() string

Error formats the lock to a string.

type ErrPrimaryMismatch

type ErrPrimaryMismatch struct {
	Key  []byte
	Lock *mvcc.Lock
}

ErrPrimaryMismatch is returned if CheckTxnStatus request is sent to a secondary lock.

func (*ErrPrimaryMismatch) Error

func (e *ErrPrimaryMismatch) Error() string

type ErrRetryable

type ErrRetryable string

ErrRetryable suggests that client may restart the txn. e.g. write conflict.

func (ErrRetryable) Error

func (e ErrRetryable) Error() string

type ErrTxnNotFound

type ErrTxnNotFound struct {
	StartTS    uint64
	PrimaryKey []byte
}

ErrTxnNotFound is returned if the required txn info not found on storage

func (*ErrTxnNotFound) Error

func (*ErrTxnNotFound) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL