errors

package
v0.0.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ClickhouseDDLTimeout is default value of distributed_ddl_task_timeout CH setting, used as fallback
	ClickhouseDDLTimeout = 180
	// DDLTimeoutCorrection is added to DDL query timeout to have a chance to catch CH error, instead of ContextDeadlineExceeded
	DDLTimeoutCorrection  = 2
	ClickhouseReadTimeout = 30 * time.Second
)

Variables

View Source
var ForbiddenDistributedDDLError = xerrors.New("detected Clickhouse cluster with multiple nodes and without distributed DDL support")
View Source
var (
	// full list of error codes here - https://github.com/ClickHouse/ClickHouse/blob/master/src/Common/ErrorCodes.cpp
	RetryableCode = map[int32]bool{
		16:  true,
		21:  true,
		22:  true,
		23:  true,
		24:  true,
		30:  true,
		31:  true,
		32:  true,
		33:  true,
		95:  true,
		96:  true,
		97:  true,
		98:  true,
		101: true,
		102: true,
		114: true,
		159: true,
		160: true,
		164: true,
		170: true,
		198: true,
		201: true,
		202: true,
		203: true,
		204: true,
		209: true,
		210: true,
		212: true,
		214: true,
		225: true,
		236: true,
		241: true,
		242: true,
		243: true,
		244: true,
		252: true,
		274: true,
		275: true,
		286: true,
		290: true,
		319: true,
		394: true,
		412: true,
		415: true,
		416: true,
		492: true,
		499: true,
		999: true,
	}
)
View Source
var (
	UpdateToastsError = coded.Register("ch", "update_toast_error")
)

Functions

func IsClickhouseError

func IsClickhouseError(err error) bool

func IsDistributedDDLError

func IsDistributedDDLError(err error) bool

func IsFatalClickhouseError

func IsFatalClickhouseError(err error) bool

Types

type DDLTaskError

type DDLTaskError struct {
	ExecShards  int
	TotalShards int
}

func MakeDDLTaskError

func MakeDDLTaskError(exec, total int) DDLTaskError

func (DDLTaskError) Error

func (e DDLTaskError) Error() string

type ErrDistributedDDLTimeout

type ErrDistributedDDLTimeout struct {
	ZKTaskPath string
	// contains filtered or unexported fields
}

func AsDistributedDDLTimeout

func AsDistributedDDLTimeout(err error) *ErrDistributedDDLTimeout

AsDistributedDDLTimeout checks whether err is clickhouse DDL timeout error and finds DDL task path

func (*ErrDistributedDDLTimeout) Error

func (e *ErrDistributedDDLTimeout) Error() string

func (*ErrDistributedDDLTimeout) Unwrap

func (e *ErrDistributedDDLTimeout) Unwrap() error

Unwrap implements xerrors.Uwrapper

Jump to

Keyboard shortcuts

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