error

package
v2.0.0-...-5317c89 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

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")
	// ErrTiKVDiskFull is the error when tikv server disk usage is full.
	ErrTiKVDiskFull = errors.New("tikv disk full")
	// ErrRegionRecoveryInProgress is the error when region is recovering.
	ErrRegionRecoveryInProgress = errors.New("region is being online unsafe recovered")
	// ErrRegionFlashbackInProgress is the error when a region in the flashback progress receive any other request.
	ErrRegionFlashbackInProgress = errors.New("region is in the flashback progress")
	// ErrRegionFlashbackNotPrepared is the error when a region is not prepared for the flashback first.
	ErrRegionFlashbackNotPrepared = errors.New("region is not prepared for the flashback")
	// ErrUnknown is the unknow error.
	ErrUnknown = errors.New("unknow")
	// ErrResultUndetermined is the error when execution result is unknown.
	ErrResultUndetermined = errors.New("execution result undetermined")
)

Functions

func ExtractKeyErr

func ExtractKeyErr(keyErr *kvrpcpb.KeyError) error

ExtractKeyErr extracts a KeyError.

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 IsErrorUndetermined

func IsErrorUndetermined(err error) bool

IsErrorUndetermined checks if the error is undetermined error.

func Log

func Log(err error)

Log logs the error if it is not nil.

func NewErrPDServerTimeout

func NewErrPDServerTimeout(msg string) error

NewErrPDServerTimeout creates an ErrPDServerTimeout.

Types

type ErrAssertionFailed

type ErrAssertionFailed struct {
	*kvrpcpb.AssertionFailed
}

ErrAssertionFailed is the error that assertion on data failed.

func (*ErrAssertionFailed) Error

func (e *ErrAssertionFailed) Error() string

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 ErrLockOnlyIfExistsNoPrimaryKey

type ErrLockOnlyIfExistsNoPrimaryKey struct {
	StartTS     uint64
	ForUpdateTs uint64
	LockKey     []byte
}

ErrLockOnlyIfExistsNoPrimaryKey is used when the flag `LockOnlyIfExists` of `LockCtx` is set, but primary key of current transaction is not.

func (*ErrLockOnlyIfExistsNoPrimaryKey) Error

type ErrLockOnlyIfExistsNoReturnValue

type ErrLockOnlyIfExistsNoReturnValue struct {
	StartTS     uint64
	ForUpdateTs uint64
	LockKey     []byte
}

ErrLockOnlyIfExistsNoReturnValue is used when the flag `LockOnlyIfExists` of `LockCtx` is set, but `ReturnValues“ is not.

func (*ErrLockOnlyIfExistsNoReturnValue) Error

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 NewErrWriteConflictWithArgs

func NewErrWriteConflictWithArgs(startTs, conflictTs, conflictCommitTs uint64, key []byte, reason kvrpcpb.WriteConflict_Reason) *ErrWriteConflict

NewErrWriteConflictWithArgs 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