Documentation ¶
Index ¶
- Constants
- func CompleteDeleteRange(sctx sessionctx.Context, dr DelRangeTask, needToRecordDone bool) error
- func DeleteDoneRecord(sctx sessionctx.Context, dr DelRangeTask) error
- func DeleteKeyFromEtcd(key string, etcdCli *clientv3.Client, retryCnt int, timeout time.Duration) error
- func EmulatorGCDisable()
- func EmulatorGCEnable()
- func GetInternalResourceGroupTaggerForTopSQL() tikvrpc.ResourceGroupTagger
- func GetTimeZone(sctx sessionctx.Context) (string, int)
- func IsContextDone(ctx context.Context) bool
- func IsEmulatorGCEnable() bool
- func IsInternalResourceGroupTaggerForTopSQL(tag []byte) bool
- func LoadDDLReorgVars(ctx context.Context, sctx sessionctx.Context) error
- func LoadDDLVars(ctx sessionctx.Context) error
- func LoadGlobalVars(ctx context.Context, sctx sessionctx.Context, varNames []string) error
- func PutKVToEtcd(ctx context.Context, etcdCli *clientv3.Client, retryCnt int, key, val string, ...) error
- func RemoveFromGCDeleteRange(sctx sessionctx.Context, jobID, elementID int64) error
- func RemoveMultiFromGCDeleteRange(ctx context.Context, sctx sessionctx.Context, jobID int64) error
- func UpdateDeleteRange(sctx sessionctx.Context, dr DelRangeTask, newStartKey, oldStartKey kv.Key) error
- type DeadTableLockChecker
- type DelRangeTask
- type Event
Constants ¶
const ( // KeyOpDefaultTimeout is the default timeout for each key operation. KeyOpDefaultTimeout = 2 * time.Second // KeyOpRetryInterval is the interval between two key operations. KeyOpRetryInterval = 30 * time.Millisecond // DDLAllSchemaVersions is the path on etcd that is used to store all servers current schema versions. DDLAllSchemaVersions = "/tidb/ddl/all_schema_versions" // DDLAllSchemaVersionsByJob is the path on etcd that is used to store all servers current schema versions. DDLAllSchemaVersionsByJob = "/tidb/ddl/all_schema_by_job_versions" // DDLGlobalSchemaVersion is the path on etcd that is used to store the latest schema versions. DDLGlobalSchemaVersion = "/tidb/ddl/global_schema_version" // ServerGlobalState is the path on etcd that is used to store the server global state. ServerGlobalState = "/tidb/server/global_state" // SessionTTL is the etcd session's TTL in seconds. SessionTTL = 90 )
Variables ¶
This section is empty.
Functions ¶
func CompleteDeleteRange ¶
func CompleteDeleteRange(sctx sessionctx.Context, dr DelRangeTask, needToRecordDone bool) error
CompleteDeleteRange moves a record from gc_delete_range table to gc_delete_range_done table.
func DeleteDoneRecord ¶
func DeleteDoneRecord(sctx sessionctx.Context, dr DelRangeTask) error
DeleteDoneRecord removes a record from gc_delete_range_done table.
func DeleteKeyFromEtcd ¶
func DeleteKeyFromEtcd(key string, etcdCli *clientv3.Client, retryCnt int, timeout time.Duration) error
DeleteKeyFromEtcd deletes key value from etcd.
func EmulatorGCDisable ¶
func EmulatorGCDisable()
EmulatorGCDisable disables emulator gc. It exports for testing.
func EmulatorGCEnable ¶
func EmulatorGCEnable()
EmulatorGCEnable enables emulator gc. It exports for testing.
func GetInternalResourceGroupTaggerForTopSQL ¶
func GetInternalResourceGroupTaggerForTopSQL() tikvrpc.ResourceGroupTagger
GetInternalResourceGroupTaggerForTopSQL only use for testing.
func GetTimeZone ¶
func GetTimeZone(sctx sessionctx.Context) (string, int)
GetTimeZone gets the session location's zone name and offset.
func IsContextDone ¶
IsContextDone checks if context is done.
func IsEmulatorGCEnable ¶
func IsEmulatorGCEnable() bool
IsEmulatorGCEnable indicates whether emulator GC enabled. It exports for testing.
func IsInternalResourceGroupTaggerForTopSQL ¶
IsInternalResourceGroupTaggerForTopSQL use for testing.
func LoadDDLReorgVars ¶
func LoadDDLReorgVars(ctx context.Context, sctx sessionctx.Context) error
LoadDDLReorgVars loads ddl reorg variable from mysql.global_variables.
func LoadDDLVars ¶
func LoadDDLVars(ctx sessionctx.Context) error
LoadDDLVars loads ddl variable from mysql.global_variables.
func LoadGlobalVars ¶
LoadGlobalVars loads global variable from mysql.global_variables.
func PutKVToEtcd ¶
func PutKVToEtcd(ctx context.Context, etcdCli *clientv3.Client, retryCnt int, key, val string, opts ...clientv3.OpOption) error
PutKVToEtcd puts key value to etcd. etcdCli is client of etcd. retryCnt is retry time when an error occurs. opts are configures of etcd Operations.
func RemoveFromGCDeleteRange ¶
func RemoveFromGCDeleteRange(sctx sessionctx.Context, jobID, elementID int64) error
RemoveFromGCDeleteRange is exported for ddl pkg to use.
func RemoveMultiFromGCDeleteRange ¶
RemoveMultiFromGCDeleteRange is exported for ddl pkg to use.
func UpdateDeleteRange ¶
func UpdateDeleteRange(sctx sessionctx.Context, dr DelRangeTask, newStartKey, oldStartKey kv.Key) error
UpdateDeleteRange is only for emulator.
Types ¶
type DeadTableLockChecker ¶
type DeadTableLockChecker struct {
// contains filtered or unexported fields
}
DeadTableLockChecker uses to check dead table locks. If tidb-server panic or killed by others, the table locks hold by the killed tidb-server maybe doesn't released.
func NewDeadTableLockChecker ¶
func NewDeadTableLockChecker(etcdCli *clientv3.Client) DeadTableLockChecker
NewDeadTableLockChecker creates new DeadLockChecker.
func (*DeadTableLockChecker) GetDeadLockedTables ¶
func (d *DeadTableLockChecker) GetDeadLockedTables(ctx context.Context, schemas []*model.DBInfo) (map[model.SessionInfo][]model.TableLockTpInfo, error)
GetDeadLockedTables gets dead locked tables.
type DelRangeTask ¶
DelRangeTask is for run delete-range command in gc_worker.
func LoadDeleteRanges ¶
func LoadDeleteRanges(ctx context.Context, sctx sessionctx.Context, safePoint uint64) (ranges []DelRangeTask, _ error)
LoadDeleteRanges loads delete range tasks from gc_delete_range table.
func LoadDoneDeleteRanges ¶
func LoadDoneDeleteRanges(ctx context.Context, sctx sessionctx.Context, safePoint uint64) (ranges []DelRangeTask, _ error)
LoadDoneDeleteRanges loads deleted ranges from gc_delete_range_done table.
type Event ¶
type Event struct { TableInfo *model.TableInfo PartInfo *model.PartitionInfo IndexInfo *model.IndexInfo ColumnInfos []*model.ColumnInfo Tp model.ActionType }
Event is an event that a ddl operation happened.