Versions in this module Expand all Collapse all v1 v1.0.0 Aug 23, 2023 v0 v0.1.0 Aug 23, 2023 Changes in this version + var ErrAllocTableRowIDs = errors.Normalize("allocate table row id error", ...) + var ErrCheckCDCPiTR = errors.Normalize("check TiCDC/PiTR task error", ...) + var ErrCheckCSVHeader = errors.Normalize("check csv header error", ...) + var ErrCheckClusterRegion = errors.Normalize("check tikv cluster region error", ...) + var ErrCheckDataSource = errors.Normalize("check data source error", ...) + var ErrCheckKVVersion = errors.Normalize("check tikv version error", ...) + var ErrCheckLocalFile = errors.Normalize("cannot find local file for table: %s engineDir: %s", ...) + var ErrCheckLocalResource = errors.Normalize("check local storage resource error", ...) + var ErrCheckMultiIngest = errors.Normalize("check multi-ingest support error", ...) + var ErrCheckTableEmpty = errors.Normalize("check table empty error", ...) + var ErrCheckpointNotFound = errors.Normalize("checkpoint not found", ...) + var ErrCheckpointSchemaConflict = errors.Normalize("checkpoint schema conflict", ...) + var ErrChecksumMismatch = errors.Normalize(...) + var ErrCleanCheckpoint = errors.Normalize("clean checkpoint error", ...) + var ErrCreateKVClient = errors.Normalize("create kv client error", errors.RFCCodeText("Lightning:KV:ErrCreateKVClient")) + var ErrCreatePDClient = errors.Normalize("create pd client error", errors.RFCCodeText("Lightning:PD:ErrCreatePDClient")) + var ErrCreateSchema = errors.Normalize("create schema failed, table: %s, stmt: %s", ...) + var ErrDBConnect = errors.Normalize("failed to connect database", errors.RFCCodeText("Lightning:DB:ErrDBConnect")) + var ErrEmptySourceDir = errors.Normalize("data-source-dir '%s' doesn't exist or contains no files", ...) + var ErrEncodeKV = errors.Normalize("encode kv error in file %s at offset %d", ...) + var ErrFoundDuplicateKeys = errors.Normalize("found duplicate key '%s', value '%s'", ...) + var ErrInitCheckpoint = errors.Normalize("init checkpoint error", ...) + var ErrInitErrManager = errors.Normalize("init error manager error", ...) + var ErrInitMetaManager = errors.Normalize("init meta manager error", ...) + var ErrInvalidArgument = errors.Normalize("invalid argument", errors.RFCCodeText("Lightning:Common:ErrInvalidArgument")) + var ErrInvalidCheckpoint = errors.Normalize("invalid checkpoint", ...) + var ErrInvalidConfig = errors.Normalize("invalid config", errors.RFCCodeText("Lightning:Config:ErrInvalidConfig")) + var ErrInvalidMetaStatus = errors.Normalize("invalid meta status: '%s'", ...) + var ErrInvalidPermission = errors.Normalize("invalid permission", ...) + var ErrInvalidSchemaFile = errors.Normalize("invalid schema file", ...) + var ErrInvalidSchemaStmt = errors.Normalize("invalid schema statement: '%s'", ...) + var ErrInvalidSortedKVDir = errors.Normalize(...) + var ErrInvalidStorageConfig = errors.Normalize("invalid data-source-dir", ...) + var ErrInvalidTLSConfig = errors.Normalize("invalid tls config", ...) + var ErrKVEpochNotMatch = errors.Normalize("epoch not match", errors.RFCCodeText("Lightning:KV:EpochNotMatch")) + var ErrKVIngestFailed = errors.Normalize("ingest tikv failed", errors.RFCCodeText("Lightning:KV:ErrKVIngestFailed")) + var ErrKVNotLeader = errors.Normalize("not leader", errors.RFCCodeText("Lightning:KV:NotLeader")) + var ErrKVRaftProposalDropped = errors.Normalize("raft proposal dropped", ...) + var ErrKVReadIndexNotReady = errors.Normalize("read index not ready", errors.RFCCodeText("Lightning:KV:ReadIndexNotReady")) + var ErrKVRegionNotFound = errors.Normalize("region not found", errors.RFCCodeText("Lightning:KV:RegionNotFound")) + var ErrKVServerIsBusy = errors.Normalize("server is busy", errors.RFCCodeText("Lightning:KV:ServerIsBusy")) + var ErrMetaMgrUnknown = errors.Normalize("unknown error occur on meta manager", ...) + var ErrOpenCheckpoint = errors.Normalize("open checkpoint error", ...) + var ErrOpenDuplicateDB = errors.Normalize("open duplicate db error", ...) + var ErrParseConfigFile = errors.Normalize("cannot parse config file '%s'", ...) + var ErrPauseGC = errors.Normalize("pause gc error", errors.RFCCodeText("Lightning:PD:ErrPauseGC")) + var ErrPreCheckFailed = errors.Normalize("tidb-lightning pre-check failed: %s", ...) + var ErrReadCheckpoint = errors.Normalize("read checkpoint error", ...) + var ErrReadConfigFile = errors.Normalize("cannot read config file '%s'", ...) + var ErrResolveDuplicateRows = errors.Normalize("resolve duplicate rows error on table '%s'", ...) + var ErrRestoreTable = errors.Normalize("restore table %s failed", ...) + var ErrSchemaNotExists = errors.Normalize("table `%s`.`%s` schema not found", ...) + var ErrStorageUnknown = errors.Normalize("unknown storage error", ...) + var ErrSystemRequirementNotMet = errors.Normalize("system requirement not met", ...) + var ErrTableIsChecksuming = errors.Normalize("table '%s' is checksuming", ...) + var ErrTableRoute = errors.Normalize("table route error", errors.RFCCodeText("Lightning:Loader:ErrTableRoute")) + var ErrTooManySourceFiles = errors.Normalize("too many source files", ...) + var ErrUnknown = errors.Normalize("unknown error", errors.RFCCodeText("Lightning:Common:ErrUnknown")) + var ErrUnknownBackend = errors.Normalize("unknown backend %s", ...) + var ErrUnknownCheckpointDriver = errors.Normalize("unknown checkpoint driver '%s'", ...) + var ErrUnknownColumns = errors.Normalize("unknown columns in header (%s) for table %s", ...) + var ErrUpdateCheckpoint = errors.Normalize("update checkpoint error", ...) + var ErrUpdatePD = errors.Normalize("update pd error", errors.RFCCodeText("Lightning:PD:ErrUpdatePD")) + var ErrVersionMismatch = errors.Normalize("version mismatch", errors.RFCCodeText("Lightning:Common:ErrVersionMismatch")) + func ConnectMySQL(cfg *mysql.Config) (*sql.DB, error) + func EscapeIdentifier(identifier string) string + func GetAutoRandomColumn(tblInfo *model.TableInfo) *model.ColumnInfo + func GetJSON(ctx context.Context, client *http.Client, url string, v interface{}) error + func GetMockTLSUrl(tls *TLS) string + func InterpolateMySQLString(s string) string + func IsContextCanceledError(err error) bool + func IsDirExists(name string) bool + func IsEmptyDir(name string) bool + func IsRetryableError(err error) bool + func KillMySelf() error + func NormalizeError(err error) error + func NormalizeOrWrapErr(rfcErr *errors.Error, err error, args ...interface{}) error + func Retry(purpose string, parentLogger log.Logger, action func() error) error + func SameDisk(dir1 string, dir2 string) (bool, error) + func SchemaExists(ctx context.Context, db utils.QueryExecutor, schema string) (bool, error) + func StringSliceEqual(a, b []string) bool + func TableExists(ctx context.Context, db utils.QueryExecutor, schema, table string) (bool, error) + func TableHasAutoID(info *model.TableInfo) bool + func TableHasAutoRowID(info *model.TableInfo) bool + func UniqueTable(schema string, table string) string + func WriteMySQLIdentifier(builder *strings.Builder, identifier string) + type ConnPool struct + func NewConnPool(capacity int, newConn func(ctx context.Context) (*grpc.ClientConn, error), ...) *ConnPool + func (p *ConnPool) Close() + func (p *ConnPool) TakeConns() (conns []*grpc.ClientConn) + type GRPCConns struct + func NewGRPCConns() *GRPCConns + func (conns *GRPCConns) Close() + func (conns *GRPCConns) GetGrpcConn(ctx context.Context, storeID uint64, tcpConcurrency int, ...) (*grpc.ClientConn, error) + type KvPair struct + Key []byte + RowID int64 + Val []byte + type MySQLConnectParam struct + Host string + MaxAllowedPacket uint64 + Password string + Port int + SQLMode string + TLS string + User string + Vars map[string]string + func (param *MySQLConnectParam) Connect() (*sql.DB, error) + func (param *MySQLConnectParam) ToDriverConfig() *mysql.Config + type OnceError struct + func (oe *OnceError) Get() error + func (oe *OnceError) Set(e error) + type Pauser struct + func NewPauser() *Pauser + func (p *Pauser) IsPaused() bool + func (p *Pauser) Pause() + func (p *Pauser) Resume() + func (p *Pauser) Wait(ctx context.Context) error + type SQLWithRetry struct + DB utils.DBExecutor + HideQueryLog bool + Logger log.Logger + func (t SQLWithRetry) Exec(ctx context.Context, purpose string, query string, args ...interface{}) error + func (t SQLWithRetry) QueryRow(ctx context.Context, purpose string, query string, dest ...interface{}) error + func (t SQLWithRetry) Transact(ctx context.Context, purpose string, ...) error + type StorageSize struct + Available uint64 + Capacity uint64 + func GetStorageSize(dir string) (size StorageSize, err error) + type TLS struct + func NewTLS(caPath, certPath, keyPath, host string, caBytes, certBytes, keyBytes []byte) (*TLS, error) + func NewTLSFromMockServer(server *httptest.Server) *TLS + func (tc *TLS) GetJSON(ctx context.Context, path string, v interface{}) error + func (tc *TLS) TLSConfig() *tls.Config + func (tc *TLS) ToGRPCDialOption() grpc.DialOption + func (tc *TLS) ToPDSecurityOption() pd.SecurityOption + func (tc *TLS) ToTiKVSecurityConfig() config.Security + func (tc *TLS) WithHost(host string) *TLS + func (tc *TLS) WrapListener(l net.Listener) net.Listener