proc

package
v1.16.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServicePump is the service ID for Pump.
	ServicePump ServiceID = "pump"
	// ServiceDrainer is the service ID for Drainer.
	ServiceDrainer ServiceID = "drainer"

	// ComponentPump is the repository component ID for Pump.
	ComponentPump RepoComponentID = "pump"
	// ComponentDrainer is the repository component ID for Drainer.
	ComponentDrainer RepoComponentID = "drainer"
)
View Source
const (
	// ServiceTiCDC is the service ID for TiCDC.
	ServiceTiCDC ServiceID = "ticdc"
	// ServiceTiKVCDC is the service ID for TiKV CDC.
	ServiceTiKVCDC ServiceID = "tikv-cdc"

	// ComponentCDC is the repository component ID for TiCDC.
	ComponentCDC RepoComponentID = "cdc"
	// ComponentTiKVCDC is the repository component ID for TiKV CDC.
	ComponentTiKVCDC RepoComponentID = "tikv-cdc"
)
View Source
const (
	// ServiceDMMaster is the service ID for DM-master.
	ServiceDMMaster ServiceID = "dm-master"
	// ServiceDMWorker is the service ID for DM-worker.
	ServiceDMWorker ServiceID = "dm-worker"

	// ComponentDMMaster is the repository component ID for DM-master.
	ComponentDMMaster RepoComponentID = "dm-master"
	// ComponentDMWorker is the repository component ID for DM-worker.
	ComponentDMWorker RepoComponentID = "dm-worker"
)
View Source
const (
	// ServicePrometheus is the service ID for the Prometheus instance.
	ServicePrometheus ServiceID = "prometheus"
	// ServiceGrafana is the service ID for the Grafana instance.
	ServiceGrafana ServiceID = "grafana"
	// ServiceNGMonitoring is the service ID for NG Monitoring.
	ServiceNGMonitoring ServiceID = "ng-monitoring"

	// ComponentPrometheus is the repository component ID for Prometheus.
	ComponentPrometheus RepoComponentID = "prometheus"
	// ComponentGrafana is the repository component ID for Grafana.
	ComponentGrafana RepoComponentID = "grafana"
	// ComponentNGMonitoring is the repository component ID for NG Monitoring.
	ComponentNGMonitoring RepoComponentID = "ng-monitoring"
)
View Source
const (
	// ServicePD is the service ID for PD.
	ServicePD ServiceID = "pd"
	// ServicePDAPI is the service ID for the PD API-only service.
	ServicePDAPI ServiceID = "pd-api"
	// ServicePDTSO is the service ID for the PD TSO-only service.
	ServicePDTSO ServiceID = "pd-tso"
	// ServicePDScheduling is the service ID for the PD Scheduling-only service.
	ServicePDScheduling ServiceID = "pd-scheduling"
	// ServicePDRouter is the service ID for the PD Router-only service.
	ServicePDRouter ServiceID = "pd-router"
	// ServicePDResourceManager is the service ID for the PD Resource Manager-only service.
	ServicePDResourceManager ServiceID = "pd-resource-manager"

	// ComponentPD is the repository component ID for PD.
	ComponentPD RepoComponentID = "pd"
)
View Source
const (
	// PortNamePort is the standard key for the main listen port in
	// ServiceSharedPlan.Ports.
	PortNamePort = "port"
	// PortNameStatusPort is the standard key for the status/metrics port in
	// ServiceSharedPlan.Ports.
	PortNameStatusPort = "statusPort"
)
View Source
const (
	// ServiceTiDB is the service ID for TiDB.
	ServiceTiDB ServiceID = "tidb"
	// ServiceTiDBSystem is the service ID for the internal TiDB system service.
	ServiceTiDBSystem ServiceID = "tidb-system"

	// ComponentTiDB is the repository component ID for TiDB.
	ComponentTiDB RepoComponentID = "tidb"
)
View Source
const (
	// ServiceTiFlash is the service ID for TiFlash.
	ServiceTiFlash ServiceID = "tiflash"
	// ServiceTiFlashWrite is the service ID for the TiFlash write node service.
	ServiceTiFlashWrite ServiceID = "tiflash-write"
	// ServiceTiFlashCompute is the service ID for the TiFlash compute node service.
	ServiceTiFlashCompute ServiceID = "tiflash-compute"

	// ComponentTiFlash is the repository component ID for TiFlash.
	ComponentTiFlash RepoComponentID = "tiflash"
)
View Source
const (
	// ServiceTiKV is the service ID for TiKV.
	ServiceTiKV ServiceID = "tikv"

	// ComponentTiKV is the repository component ID for TiKV.
	ComponentTiKV RepoComponentID = "tikv"
)
View Source
const (
	// ServiceTiKVWorker is the service ID for TiKV-worker.
	ServiceTiKVWorker ServiceID = "tikv-worker"

	// ComponentTiKVWorker is the repository component ID for TiKV-worker.
	ComponentTiKVWorker RepoComponentID = "tikv-worker"
)
View Source
const (
	// ServiceTiProxy is the service ID for TiProxy.
	ServiceTiProxy ServiceID = "tiproxy"

	// ComponentTiProxy is the repository component ID for TiProxy.
	ComponentTiProxy RepoComponentID = "tiproxy"
)

Variables

View Source
var (
	// ModeNormal is the default mode.
	ModeNormal = "tidb"
	// ModeCSE is for CSE testing.
	ModeCSE = "tidb-cse"
	// ModeNextGen is for NG testing.
	ModeNextGen = "tidb-x"
	// ModeDisAgg is for tiflash testing.
	ModeDisAgg = "tiflash-disagg"
	// ModeTiKVSlim is for special tikv testing.
	ModeTiKVSlim = "tikv-slim"
)
View Source
var SysProcAttr = &syscall.SysProcAttr{
	Pdeathsig: syscall.SIGKILL,
	Setpgid:   true,
}

SysProcAttr to be use for every Process we start.

Functions

func AdvertiseHost

func AdvertiseHost(listen string) string

AdvertiseHost returns the interface's ip addr if listen host is 0.0.0.0

func ComponentDisplayName

func ComponentDisplayName(componentID RepoComponentID) string

ComponentDisplayName returns a user-facing name for a repository component ID.

If no display name is registered, it falls back to a best-effort title-cased version of the id (split by '-' or '_').

func GenTiProxySessionCerts

func GenTiProxySessionCerts(dir string) error

GenTiProxySessionCerts will create a self-signed certs for TiProxy session migration. NOTE that this cert is directly used by TiDB.

func PrepareCommand

func PrepareCommand(ctx context.Context, binPath string, args, envs []string, workDir string) *exec.Cmd

PrepareCommand return command for playground

func RegisterComponentDisplayName

func RegisterComponentDisplayName(componentID RepoComponentID, displayName string)

RegisterComponentDisplayName registers a user-facing name for a repository component ID.

It is intended to be called from the init() function of each component implementation, so the naming rules stay close to the component itself.

func RegisterServiceDisplayName

func RegisterServiceDisplayName(serviceID ServiceID, displayName string)

RegisterServiceDisplayName registers a user-facing name for a service.

It is intended to be called from the init() function of each service implementation, so the naming rules stay close to the component itself.

func ResolveSiblingBinary

func ResolveSiblingBinary(baseBinPath, want string) (string, bool)

ResolveSiblingBinary searches for an executable named want near baseBinPath.

It checks the directory containing baseBinPath and up to 3 parent directories. The returned bool reports whether the binary exists.

func ResolveTiKVWorkerBinPath

func ResolveTiKVWorkerBinPath(binPath string) string

ResolveTiKVWorkerBinPath resolves the tikv-worker binary path when a tikv-server path is provided.

func ServiceDisplayName

func ServiceDisplayName(serviceID ServiceID) string

ServiceDisplayName returns a user-facing name for a service.

If no service-specific display name is registered, it falls back to a best-effort title-cased form of the service ID.

Types

type CSEOptions

type CSEOptions struct {
	S3Endpoint string `yaml:"s3_endpoint"`
	Bucket     string `yaml:"bucket"`
	AccessKey  string `yaml:"access_key"`
	SecretKey  string `yaml:"secret_key"`
}

CSEOptions contains configs to run TiDB cluster in CSE mode.

type Config

type Config struct {
	ConfigPath string `yaml:"config_path"`
	BinPath    string `yaml:"bin_path"`
	Num        int    `yaml:"num"`
	Host       string `yaml:"host"`
	Port       int    `yaml:"port"`
	UpTimeout  int    `yaml:"up_timeout"`
	Version    string `yaml:"version"`
}

Config of the instance.

type DMMaster

type DMMaster struct {
	ProcessInfo
	Plan DMMasterPlan
}

DMMaster represent a DM master instance.

func (*DMMaster) Addr

func (m *DMMaster) Addr() string

Addr return the address of the instance.

func (*DMMaster) LogFile

func (m *DMMaster) LogFile() string

LogFile return the log file path of the instance.

func (*DMMaster) Prepare

func (m *DMMaster) Prepare(ctx context.Context) error

Prepare builds the DM-master process command.

func (*DMMaster) WaitReady

func (m *DMMaster) WaitReady(ctx context.Context) error

WaitReady implements ReadyWaiter.

DM-master is considered ready when it is active (or leader) in the DM cluster.

type DMMasterPlan

type DMMasterPlan struct {
	InitialCluster []DMMemberPlan
	RequireReady   bool
}

DMMasterPlan is the service-specific plan for DM-master.

type DMMemberPlan

type DMMemberPlan struct {
	Name       string
	PeerAddr   string // host:peerPort
	MasterAddr string // host:statusPort
}

DMMemberPlan is one member in the DM initial cluster.

type DMWorker

type DMWorker struct {
	ProcessInfo
	Plan DMWorkerPlan
}

DMWorker represent a DM worker instance.

func (*DMWorker) LogFile

func (w *DMWorker) LogFile() string

LogFile return the log file of the instance.

func (*DMWorker) MasterAddrs

func (w *DMWorker) MasterAddrs() []string

MasterAddrs return the master addresses.

func (*DMWorker) Prepare

func (w *DMWorker) Prepare(ctx context.Context) error

Prepare builds the DM-worker process command.

type DMWorkerPlan

type DMWorkerPlan struct {
	MasterAddrs []string // host:statusPort
}

DMWorkerPlan is the service-specific plan for DM-worker.

type Drainer

type Drainer struct {
	ProcessInfo
	Plan DrainerPlan
}

Drainer represent a drainer instance.

func (*Drainer) Addr

func (d *Drainer) Addr() string

Addr return the address of Drainer.

func (*Drainer) LogFile

func (d *Drainer) LogFile() string

LogFile return the log file name.

func (*Drainer) Prepare

func (d *Drainer) Prepare(ctx context.Context) error

Prepare builds the Drainer process command.

type DrainerPlan

type DrainerPlan struct{ PDAddrs []string }

DrainerPlan is the service-specific plan for Drainer.

type GrafanaInstance

type GrafanaInstance struct {
	ProcessInfo

	PrometheusURL string
}

GrafanaInstance represents a running Grafana server.

func (*GrafanaInstance) LogFile

func (inst *GrafanaInstance) LogFile() string

LogFile returns the log file path for the instance.

func (*GrafanaInstance) Prepare

func (inst *GrafanaInstance) Prepare(ctx context.Context) error

Prepare builds the Grafana process command.

type GrafanaPlan

type GrafanaPlan struct {
	PrometheusURL string // http://host:port
}

GrafanaPlan is the service-specific plan for Grafana.

type MetricAddr

type MetricAddr struct {
	Targets []string          `json:"targets"`
	Labels  map[string]string `json:"labels"`
}

MetricAddr will be used by prometheus scrape_configs.

type Mode

type Mode = string

Mode of playground

type NGMonitoringInstance

type NGMonitoringInstance struct {
	ProcessInfo

	Plan NGMonitoringPlan
}

NGMonitoringInstance represents a running ng-monitoring-server.

func (*NGMonitoringInstance) LogFile

func (inst *NGMonitoringInstance) LogFile() string

LogFile returns the log file path for the instance.

func (*NGMonitoringInstance) Prepare

func (inst *NGMonitoringInstance) Prepare(ctx context.Context) error

Prepare builds the NG Monitoring process command.

type NGMonitoringPlan

type NGMonitoringPlan struct {
	PDAddrs []string
}

NGMonitoringPlan is the service-specific plan for NG Monitoring.

type OSProcess

type OSProcess interface {
	Start() error
	Wait() error
	Pid() int
	Uptime() string
	SetOutputFile(fname string) error
	Cmd() *exec.Cmd
}

OSProcess represents an operating system process started by playground.

type PDInstance

type PDInstance struct {
	ProcessInfo
	ShOpt SharedOptions
	Plan  PDPlan
}

PDInstance represent a running pd-server

func (*PDInstance) Addr

func (inst *PDInstance) Addr() string

Addr return the listen address of PD

func (*PDInstance) InitCluster

func (inst *PDInstance) InitCluster(pds []*PDInstance) *PDInstance

InitCluster set the init cluster instance.

func (*PDInstance) Join

func (inst *PDInstance) Join(pds []*PDInstance) *PDInstance

Join set endpoints field of PDInstance

func (*PDInstance) LogFile

func (inst *PDInstance) LogFile() string

LogFile return the log file.

func (*PDInstance) Prepare

func (inst *PDInstance) Prepare(ctx context.Context) error

Prepare builds the PD process command.

type PDMemberPlan

type PDMemberPlan struct {
	Name     string
	PeerAddr string // host:peerPort
}

PDMemberPlan is one member in the pd/pd-api initial cluster.

type PDPlan

type PDPlan struct {
	// InitialCluster is used by pd/pd-api (choose one of InitialCluster/JoinAddrs).
	InitialCluster []PDMemberPlan
	// JoinAddrs is used by pd/pd-api when joining an existing cluster.
	JoinAddrs []string // host:peerPort

	// BackendAddrs is used by pd-* microservices as backend endpoints.
	BackendAddrs []string // host:statusPort

	KVIsSingleReplica bool
}

PDPlan is the service-specific plan for PD-related services.

Fields are intentionally "static": executor should be able to start instances without re-deriving endpoints from other instances.

type Process

type Process interface {
	Info() *ProcessInfo

	// Prepare builds the process command (config + args) for later start.
	//
	// It does NOT start the underlying process. Playground owns the actual
	// proc.Start() call so it can consistently wire logs, waiters and readiness.
	Prepare(ctx context.Context) error
	// LogFile return the log file name
	LogFile() string
}

Process represent running component

func NewProcessFromPlan

func NewProcessFromPlan(plan ServicePlan, info ProcessInfo, shOpt SharedOptions, dataDir string) (Process, error)

NewProcessFromPlan creates a proc.Process instance from a planned service entry.

It is a centralized mapping from service IDs to proc implementations, so the controller does not need to maintain a parallel "service -> proc type" switch.

NOTE: This function does not validate ports/dirs beyond what is necessary for process construction. Planner and controller are responsible for those checks.

type ProcessInfo

type ProcessInfo struct {
	ID         int
	Dir        string
	Host       string
	Port       int
	StatusPort int // client port for PD
	// UpTimeout is the maximum wait time (in seconds) for the instance to become
	// ready.
	//
	// It is only used by components that implement readiness checks (e.g. TiDB,
	// TiProxy, TiFlash). A value <= 0 means no limit.
	UpTimeout  int
	ConfigPath string
	// UserBinPath is the binary path provided by the user (if any).
	//
	// It is treated as input and must not be overwritten by binary resolution.
	UserBinPath string
	// BinPath is the resolved executable path used to start the instance.
	//
	// It is set by the playground planner/preloader and may come from either a
	// user-provided path or a repository-installed component.
	BinPath         string
	Version         utils.Version
	Proc            OSProcess
	RepoComponentID RepoComponentID
	Service         ServiceID
}

ProcessInfo holds the shared, low-level fields for a running playground instance.

Concrete instances embed it and expose it via the Process.Info method.

func (*ProcessInfo) DisplayName

func (info *ProcessInfo) DisplayName() string

DisplayName returns the user-facing display name for an instance (no index included).

func (*ProcessInfo) Info

func (info *ProcessInfo) Info() *ProcessInfo

Info returns itself so embedded ProcessInfo can satisfy Process.

func (*ProcessInfo) MetricAddr

func (info *ProcessInfo) MetricAddr() (r MetricAddr)

MetricAddr returns the default address to pull metrics.

Specific instances can override it by defining their own MetricAddr method.

func (*ProcessInfo) Name

func (info *ProcessInfo) Name() string

Name returns the stable instance name used by the underlying component flags and topology.

type PrometheusInstance

type PrometheusInstance struct {
	ProcessInfo
	// contains filtered or unexported fields
}

PrometheusInstance represents a running Prometheus server.

func (*PrometheusInstance) LogFile

func (inst *PrometheusInstance) LogFile() string

LogFile returns the log file path for the instance.

func (*PrometheusInstance) Prepare

func (inst *PrometheusInstance) Prepare(ctx context.Context) error

Prepare builds the Prometheus process command.

func (*PrometheusInstance) RenderSDFile

func (inst *PrometheusInstance) RenderSDFile(sid2targets map[ServiceID]MetricAddr) error

RenderSDFile writes Prometheus file_sd targets for all instances. ref: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#file_sd_config

type Pump

type Pump struct {
	ProcessInfo
	Plan PumpPlan
}

Pump represent a pump instance.

func (*Pump) Addr

func (p *Pump) Addr() string

Addr return the address of Pump.

func (*Pump) LogFile

func (p *Pump) LogFile() string

LogFile return the log file.

func (*Pump) Prepare

func (p *Pump) Prepare(ctx context.Context) error

Prepare builds the Pump process command.

func (*Pump) Ready

func (p *Pump) Ready(ctx context.Context) error

Ready return nil when pump is ready to serve.

func (*Pump) WaitReady

func (p *Pump) WaitReady(ctx context.Context) error

WaitReady implements ReadyWaiter.

Pump does not expose a richer "ready" probe, so we reuse the /status endpoint. Historically playground used a fixed 120s timeout for this step; keep the same default when UpTimeout is not configured.

type PumpPlan

type PumpPlan struct{ PDAddrs []string }

PumpPlan is the service-specific plan for Pump.

type ReadyWaiter

type ReadyWaiter interface {
	// WaitReady blocks until the instance is ready, or ctx is done.
	//
	// The maximum waiting time should usually be controlled by the instance's
	// UpTimeout field (in seconds). A value <= 0 means no limit.
	WaitReady(ctx context.Context) error
}

ReadyWaiter is an optional interface implemented by instances that need an explicit "ready" check after the process has been started.

It is intentionally separated from the core Process interface so most components can remain "start-and-done", while components like TiDB / TiProxy / TiFlash can keep showing a spinner until they are actually ready to serve.

type RepoComponentID

type RepoComponentID string

RepoComponentID is a TiUP repository component ID.

It is used for version resolution, downloading and locating binaries.

func (RepoComponentID) String

func (id RepoComponentID) String() string

type ServiceID

type ServiceID string

ServiceID is a logical service identifier in playground.

A ServiceID represents one start behavior (args/config/ports/ready strategy), and is what playground orchestration should use for planning, dependency and "critical" semantics.

ServiceID is mode-independent. Mode only affects how a ServiceID maps to a RepoComponentID and its start implementation.

func (ServiceID) String

func (id ServiceID) String() string

type ServicePlan

type ServicePlan struct {
	Name      string
	ServiceID string

	StartAfterServices []string

	ComponentID     string
	ResolvedVersion string
	BinPath         string

	Shared ServiceSharedPlan

	// Service-specific inputs (strong schema).
	PD           *PDPlan           `json:",omitempty"`
	TiKV         *TiKVPlan         `json:",omitempty"`
	TiDB         *TiDBPlan         `json:",omitempty"`
	TiKVWorker   *TiKVWorkerPlan   `json:",omitempty"`
	TiFlash      *TiFlashPlan      `json:",omitempty"`
	TiProxy      *TiProxyPlan      `json:",omitempty"`
	Grafana      *GrafanaPlan      `json:",omitempty"`
	NGMonitoring *NGMonitoringPlan `json:",omitempty"`
	TiCDC        *TiCDCPlan        `json:",omitempty"`
	TiKVCDC      *TiKVCDCPlan      `json:",omitempty"`
	DMMaster     *DMMasterPlan     `json:",omitempty"`
	DMWorker     *DMWorkerPlan     `json:",omitempty"`
	Pump         *PumpPlan         `json:",omitempty"`
	Drainer      *DrainerPlan      `json:",omitempty"`

	// Debug fields (not part of execution semantics).
	DebugConstraint string
}

ServicePlan is the per-instance start plan produced by the playground planner.

It intentionally omits low-level details like argv/workdir/env/fileops. Executor is responsible for turning the plan into concrete process commands.

type ServiceSharedPlan

type ServiceSharedPlan struct {
	Dir        string
	Host       string
	Port       int
	StatusPort int

	// Ports holds additional named ports allocated during planning.
	//
	// It is a low-level, per-instance detail: planner fills it based on service
	// catalog definitions and executor/proc implementations may read it when a
	// service needs more than the standard Port/StatusPort pair (e.g. TiFlash).
	Ports map[string]int `json:",omitempty"`

	ConfigPath string
	UpTimeout  int
}

ServiceSharedPlan contains common, low-level per-instance inputs.

type SharedOptions

type SharedOptions struct {
	/// Whether or not to tune the cluster in order to run faster (instead of easier to debug).
	HighPerf           bool       `yaml:"high_perf"`
	CSE                CSEOptions `yaml:"cse"` // Only available when mode == ModeCSE or ModeDisAgg
	PDMode             string     `yaml:"pd_mode"`
	Mode               string     `yaml:"mode"`
	PortOffset         int        `yaml:"port_offset"`
	EnableTiKVColumnar bool       `yaml:"enable_tikv_columnar"` // Only available when mode == ModeCSE
	ForcePull          bool       `yaml:"force_pull"`
}

SharedOptions contains some commonly used, tunable options for most components. Unlike Config, these options are shared for all instances of all components.

type TiCDC

type TiCDC struct {
	ProcessInfo
	Plan TiCDCPlan
}

TiCDC represent a ticdc instance.

func (*TiCDC) LogFile

func (c *TiCDC) LogFile() string

LogFile return the log file.

func (*TiCDC) Prepare

func (c *TiCDC) Prepare(ctx context.Context) error

Prepare builds the TiCDC process command.

type TiCDCPlan

type TiCDCPlan struct{ PDAddrs []string }

TiCDCPlan is the service-specific plan for TiCDC.

type TiDBInstance

type TiDBInstance struct {
	ProcessInfo
	ShOpt          SharedOptions
	Plan           TiDBPlan
	TiProxyCertDir string
}

TiDBInstance represent a running tidb-server

func (*TiDBInstance) Addr

func (inst *TiDBInstance) Addr() string

Addr return the listen address of TiDB

func (*TiDBInstance) LogFile

func (inst *TiDBInstance) LogFile() string

LogFile return the log file name.

func (*TiDBInstance) Prepare

func (inst *TiDBInstance) Prepare(ctx context.Context) error

Prepare builds the TiDB process command.

func (*TiDBInstance) WaitReady

func (inst *TiDBInstance) WaitReady(ctx context.Context) error

WaitReady implements ReadyWaiter.

TiDB is considered ready when its MySQL TCP port is connectable.

type TiDBPlan

type TiDBPlan struct {
	PDAddrs []string

	EnableBinlog bool

	TiKVWorkerURLs []string // host:port
}

TiDBPlan is the service-specific plan for TiDB.

type TiFlashInstance

type TiFlashInstance struct {
	ProcessInfo
	ShOpt SharedOptions
	Plan  TiFlashPlan
}

TiFlashInstance represent a running TiFlash

func (*TiFlashInstance) Addr

func (inst *TiFlashInstance) Addr() string

Addr return the address of tiflash

func (*TiFlashInstance) LogFile

func (inst *TiFlashInstance) LogFile() string

LogFile return the log file name.

func (*TiFlashInstance) MetricAddr

func (inst *TiFlashInstance) MetricAddr() (r MetricAddr)

MetricAddr returns the address(es) to pull metrics.

func (*TiFlashInstance) Prepare

func (inst *TiFlashInstance) Prepare(ctx context.Context) error

Prepare builds the TiFlash process command.

func (*TiFlashInstance) StoreAddr

func (inst *TiFlashInstance) StoreAddr() string

StoreAddr return the store address of TiFlash

func (*TiFlashInstance) WaitReady

func (inst *TiFlashInstance) WaitReady(ctx context.Context) error

WaitReady implements ReadyWaiter.

TiFlash is considered ready once it is reported as "up" by PD.

type TiFlashPlan

type TiFlashPlan struct {
	PDAddrs []string

	// ProcessInfo.Port remains the TiFlash HTTP port.
	ServicePort     int
	TCPPort         int
	ProxyPort       int
	ProxyStatusPort int
}

TiFlashPlan is the service-specific plan for TiFlash.

type TiKVCDCInstance

type TiKVCDCInstance struct {
	ProcessInfo
	Plan TiKVCDCPlan
}

TiKVCDCInstance represent a TiKV-CDC instance.

func (*TiKVCDCInstance) LogFile

func (c *TiKVCDCInstance) LogFile() string

LogFile return the log file.

func (*TiKVCDCInstance) Prepare

func (c *TiKVCDCInstance) Prepare(ctx context.Context) error

Prepare builds the TiKV-CDC process command.

type TiKVCDCPlan

type TiKVCDCPlan struct{ PDAddrs []string }

TiKVCDCPlan is the service-specific plan for TiKV-CDC.

type TiKVInstance

type TiKVInstance struct {
	ProcessInfo
	ShOpt SharedOptions
	Plan  TiKVPlan
}

TiKVInstance represent a running tikv-server

func (*TiKVInstance) Addr

func (inst *TiKVInstance) Addr() string

Addr return the address of tikv.

func (*TiKVInstance) LogFile

func (inst *TiKVInstance) LogFile() string

LogFile return the log file name.

func (*TiKVInstance) Prepare

func (inst *TiKVInstance) Prepare(ctx context.Context) error

Prepare builds the TiKV process command.

func (*TiKVInstance) StoreAddr

func (inst *TiKVInstance) StoreAddr() string

StoreAddr return the store address of TiKV

func (*TiKVInstance) WaitReady

func (inst *TiKVInstance) WaitReady(ctx context.Context) error

WaitReady implements ReadyWaiter.

In PD microservices mode, TiKV depends on a healthy TSO service. Historically playground performed this check in Prepare(), but Prepare() should only build the process command. Keep the behavior as a cancelable readiness step.

type TiKVPlan

type TiKVPlan struct {
	PDAddrs  []string // host:statusPort
	TSOAddrs []string // host:statusPort (ms mode)
}

TiKVPlan is the service-specific plan for TiKV.

type TiKVWorkerInstance

type TiKVWorkerInstance struct {
	ProcessInfo
	ShOpt SharedOptions
	Plan  TiKVWorkerPlan
}

TiKVWorkerInstance represent a running TiKVWorker instance.

func (*TiKVWorkerInstance) Addr

func (inst *TiKVWorkerInstance) Addr() string

Addr return the address of TiKVWorker.

func (*TiKVWorkerInstance) LogFile

func (inst *TiKVWorkerInstance) LogFile() string

LogFile return the log file name.

func (*TiKVWorkerInstance) Prepare

func (inst *TiKVWorkerInstance) Prepare(ctx context.Context) error

Prepare builds the TiKV worker process command.

type TiKVWorkerPlan

type TiKVWorkerPlan struct {
	PDAddrs []string
}

TiKVWorkerPlan is the service-specific plan for TiKV worker.

type TiProxyInstance

type TiProxyInstance struct {
	ProcessInfo
	Plan TiProxyPlan
}

TiProxyInstance represent a ticdc instance.

func (*TiProxyInstance) Addr

func (c *TiProxyInstance) Addr() string

Addr return addresses that can be connected by MySQL clients.

func (*TiProxyInstance) LogFile

func (c *TiProxyInstance) LogFile() string

LogFile return the log file.

func (*TiProxyInstance) MetricAddr

func (c *TiProxyInstance) MetricAddr() (r MetricAddr)

MetricAddr implements Process interface.

func (*TiProxyInstance) Prepare

func (c *TiProxyInstance) Prepare(ctx context.Context) error

Prepare builds the TiProxy process command.

func (*TiProxyInstance) WaitReady

func (c *TiProxyInstance) WaitReady(ctx context.Context) error

WaitReady implements ReadyWaiter.

TiProxy is considered ready when its MySQL TCP port is connectable.

type TiProxyPlan

type TiProxyPlan struct {
	PDAddrs []string
}

TiProxyPlan is the service-specific plan for TiProxy.

Jump to

Keyboard shortcuts

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