Documentation ¶
Index ¶
- Constants
- Variables
- func ExtractKeyErr(keyErr *kvrpcpb.KeyError) error
- func IsErrKeyExist(err error) bool
- func IsErrNotFound(err error) bool
- func IsErrWriteConflict(err error) bool
- func IsErrorUndetermined(err error) bool
- func Log(err error)
- func NewErrPDServerTimeout(msg string) error
- type ErrAssertionFailed
- type ErrDeadlock
- type ErrEntryTooLarge
- type ErrGCTooEarly
- type ErrKeyExist
- type ErrLockOnlyIfExistsNoPrimaryKey
- type ErrLockOnlyIfExistsNoReturnValue
- type ErrPDServerTimeout
- type ErrRetryable
- type ErrTokenLimit
- type ErrTxnTooLarge
- type ErrWriteConflict
- type ErrWriteConflictInLatch
- type PDError
Constants ¶
const MismatchClusterID = "mismatch cluster id"
MismatchClusterID represents the message that the cluster ID of the PD client does not match the PD.
Variables ¶
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 = 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") // ErrIsWitness is the error when a request is send to a witness. ErrIsWitness = errors.New("peer is witness") // 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 ¶
ExtractKeyErr extracts a KeyError.
func IsErrKeyExist ¶
IsErrKeyExist returns true if it is ErrKeyExist.
func IsErrNotFound ¶
IsErrNotFound checks if err is a kind of NotFound error.
func IsErrWriteConflict ¶
IsErrWriteConflict returns true if it is ErrWriteConflict.
func IsErrorUndetermined ¶
IsErrorUndetermined checks if the error is undetermined error.
func NewErrPDServerTimeout ¶
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 ¶
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 ¶
ErrEntryTooLarge is the error when a key value entry is too large.
func (*ErrEntryTooLarge) Error ¶
func (e *ErrEntryTooLarge) Error() string
type ErrGCTooEarly ¶
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 ¶ added in v2.0.2
ErrLockOnlyIfExistsNoPrimaryKey is used when the flag `LockOnlyIfExists` of `LockCtx` is set, but primary key of current transaction is not.
func (*ErrLockOnlyIfExistsNoPrimaryKey) Error ¶ added in v2.0.2
func (e *ErrLockOnlyIfExistsNoPrimaryKey) Error() string
type ErrLockOnlyIfExistsNoReturnValue ¶ added in v2.0.2
ErrLockOnlyIfExistsNoReturnValue is used when the flag `LockOnlyIfExists` of `LockCtx` is set, but `ReturnValues“ is not.
func (*ErrLockOnlyIfExistsNoReturnValue) Error ¶ added in v2.0.2
func (e *ErrLockOnlyIfExistsNoReturnValue) 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 NewErrWriteConflictWithArgs ¶ added in v2.0.2
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