error

package
v2.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 5 Imported by: 60

Documentation

Index

Constants

View Source
const MismatchClusterID = "mismatch cluster id"

MismatchClusterID represents the message that the cluster ID of the PD client does not match the PD.

Variables

View Source
var (
	// ErrBodyMissing response body is missing error
	ErrBodyMissing = errors.New("response body is missing")
	// ErrTiDBShuttingDown is returned when TiDB is closing and send request to tikv fail, do not retry.
	ErrTiDBShuttingDown = errors.New("tidb server shutting down")
	// ErrNotExist means the related data not exist.
	ErrNotExist = errors.New("not exist")
	// ErrCannotSetNilValue is the error when sets an empty value.
	ErrCannotSetNilValue = errors.New("can not set nil value")
	// ErrInvalidTxn is the error when commits or rollbacks in an invalid transaction.
	ErrInvalidTxn = errors.New("invalid transaction")
	// ErrTiKVServerTimeout is the error when tikv server is timeout.
	ErrTiKVServerTimeout = errors.New("tikv server timeout")
	// ErrTiFlashServerTimeout is the error when tiflash server is timeout.
	ErrTiFlashServerTimeout = errors.New("tiflash server timeout")
	// ErrQueryInterrupted is the error when the query is interrupted.
	ErrQueryInterrupted = errors.New("query interruppted")
	// ErrTiKVStaleCommand is the error that the command is stale in tikv.
	ErrTiKVStaleCommand = errors.New("tikv stale command")
	// ErrTiKVMaxTimestampNotSynced is the error that tikv's max timestamp is not synced.
	ErrTiKVMaxTimestampNotSynced = errors.New("tikv max timestamp not synced")
	// ErrLockAcquireFailAndNoWaitSet is the error that acquire the lock failed while no wait is setted.
	ErrLockAcquireFailAndNoWaitSet = errors.New("lock acquired failed and no wait is setted")
	// ErrResolveLockTimeout is the error that resolve lock timeout.
	ErrResolveLockTimeout = errors.New("resolve lock timeout")
	// ErrLockWaitTimeout is the error that wait for the lock is timeout.
	ErrLockWaitTimeout = errors.New("lock wait timeout")
	// ErrTiKVServerBusy is the error when tikv server is busy.
	ErrTiKVServerBusy = errors.New("tikv server busy")
	// ErrTiFlashServerBusy is the error that tiflash server is busy.
	ErrTiFlashServerBusy = errors.New("tiflash server busy")
	// ErrRegionUnavailable is the error when region is not available.
	ErrRegionUnavailable = errors.New("region unavailable")
	// ErrRegionDataNotReady is the error when region's data is not ready when querying it with safe_ts
	ErrRegionDataNotReady = errors.New("region data not ready")
	// ErrRegionNotInitialized is error when region is not initialized
	ErrRegionNotInitialized = errors.New("region not Initialized")
	// ErrUnknown is the unknow error.
	ErrUnknown = errors.New("unknow")
)

Functions

func IsErrKeyExist

func IsErrKeyExist(err error) bool

IsErrKeyExist returns true if it is ErrKeyExist.

func IsErrNotFound

func IsErrNotFound(err error) bool

IsErrNotFound checks if err is a kind of NotFound error.

func IsErrWriteConflict

func IsErrWriteConflict(err error) bool

IsErrWriteConflict returns true if it is ErrWriteConflict.

func NewErrPDServerTimeout

func NewErrPDServerTimeout(msg string) error

NewErrPDServerTimeout creates an ErrPDServerTimeout.

Types

type ErrDeadlock

type ErrDeadlock struct {
	*kvrpcpb.Deadlock
	IsRetryable bool
}

ErrDeadlock wraps *kvrpcpb.Deadlock to implement the error interface. It also marks if the deadlock is retryable.

func (*ErrDeadlock) Error

func (d *ErrDeadlock) Error() string

type ErrEntryTooLarge

type ErrEntryTooLarge struct {
	Limit uint64
	Size  uint64
}

ErrEntryTooLarge is the error when a key value entry is too large.

func (*ErrEntryTooLarge) Error

func (e *ErrEntryTooLarge) Error() string

type ErrGCTooEarly

type ErrGCTooEarly struct {
	TxnStartTS  time.Time
	GCSafePoint time.Time
}

ErrGCTooEarly is the error that GC life time is shorter than transaction duration

func (*ErrGCTooEarly) Error

func (e *ErrGCTooEarly) Error() string

type ErrKeyExist

type ErrKeyExist struct {
	*kvrpcpb.AlreadyExist
}

ErrKeyExist wraps *pdpb.AlreadyExist to implement the error interface.

func (*ErrKeyExist) Error

func (k *ErrKeyExist) Error() string

type ErrPDServerTimeout

type ErrPDServerTimeout struct {
	// contains filtered or unexported fields
}

ErrPDServerTimeout is the error when pd server is timeout.

func (*ErrPDServerTimeout) Error

func (e *ErrPDServerTimeout) Error() string

type ErrRetryable

type ErrRetryable struct {
	Retryable string
}

ErrRetryable wraps *kvrpcpb.Retryable to implement the error interface.

func (*ErrRetryable) Error

func (k *ErrRetryable) Error() string

type ErrTokenLimit

type ErrTokenLimit struct {
	StoreID uint64
}

ErrTokenLimit is the error that token is up to the limit.

func (*ErrTokenLimit) Error

func (e *ErrTokenLimit) Error() string

type ErrTxnTooLarge

type ErrTxnTooLarge struct {
	Size int
}

ErrTxnTooLarge is the error when transaction is too large, lock time reached the maximum value.

func (*ErrTxnTooLarge) Error

func (e *ErrTxnTooLarge) Error() string

type ErrWriteConflict

type ErrWriteConflict struct {
	*kvrpcpb.WriteConflict
}

ErrWriteConflict wraps *kvrpcpb.ErrWriteConflict to implement the error interface.

func NewErrWriteConfictWithArgs

func NewErrWriteConfictWithArgs(startTs, conflictTs, conflictCommitTs uint64, key []byte) *ErrWriteConflict

NewErrWriteConfictWithArgs generates an ErrWriteConflict with args.

func (*ErrWriteConflict) Error

func (k *ErrWriteConflict) Error() string

type ErrWriteConflictInLatch

type ErrWriteConflictInLatch struct {
	StartTS uint64
}

ErrWriteConflictInLatch is the error when the commit meets an write conflict error when local latch is enabled.

func (*ErrWriteConflictInLatch) Error

func (e *ErrWriteConflictInLatch) Error() string

type PDError

type PDError struct {
	Err *pdpb.Error
}

PDError wraps *pdpb.Error to implement the error interface.

func (*PDError) Error

func (d *PDError) Error() string

Jump to

Keyboard shortcuts

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