Versions in this module Expand all Collapse all v0 v0.16.3 Nov 29, 2024 Changes in this version + const AcceptingReadAndWrite + const AcceptingReadOnly + const DTStateCommit + const DTStatePrepare + const DTStateRollback + const NotServing + const RedoStateFailed + const RedoStatePrepared + const StateNotConnected + const StateNotServing + const StateServing + const StateShuttingDown + const StateTransitioning + const Transitioning + const TxClose + const TxCommit + const TxKill + const TxPrepare + const TxRollback + var RegisterFunctions []func(Controller) + type Controller interface + AddStatusPart func() + BroadcastHealth func(terTimestamp int64, stats *querypb.RealtimeStats, maxCache time.Duration) + ClearQueryPlanCache func() + EnterLameduck func() + HeartbeatLag func() (time.Duration, error) + InitDBConfig func(querypb.Target, *dbconfigs.DBConfigs) error + IsHealthy func() error + IsServing func() bool + QueryService func() queryservice.QueryService + Register func() + RegisterQueryRuleSource func(ruleSource string) + ReloadSchema func(ctx context.Context) error + SchemaEngine func() *schema.Engine + SetQueryRules func(ruleSource string, qrs *rules.Rules) error + SetServingType func(tabletType topodatapb.TabletType, serving bool, ...) (bool, error) + TopoServer func() *topo.Server + UnRegisterQueryRuleSource func(ruleSource string) + type DistributedTx struct + Created time.Time + Dtid string + Participants []querypb.Target + State string + type PreparedTx struct + Dtid string + Queries []string + Time time.Time + type QueryDetail struct + func NewQueryDetail(ctx context.Context, conn killable) *QueryDetail + type QueryDetailzRow struct + ConnID int64 + ContextHTML template.HTML + Duration time.Duration + Query string + ShowTerminateLink bool + Start time.Time + State string + type QueryEngine struct + func NewQueryEngine(checker connpool.MySQLChecker, se *schema.Engine, ...) *QueryEngine + func (qe *QueryEngine) AddStats(planName, tableName string, queryCount int64, ...) + func (qe *QueryEngine) ClearQueryPlanCache() + func (qe *QueryEngine) Close() + func (qe *QueryEngine) GetMessageStreamPlan(name string) (*TabletPlan, error) + func (qe *QueryEngine) GetPlan(ctx context.Context, logStats *tabletenv.LogStats, sql string, ...) (*TabletPlan, error) + func (qe *QueryEngine) GetStreamPlan(sql string) (*TabletPlan, error) + func (qe *QueryEngine) InitDBConfig(dbcfgs *dbconfigs.DBConfigs) + func (qe *QueryEngine) IsMySQLReachable() bool + func (qe *QueryEngine) Open() error + func (qe *QueryEngine) QueryPlanCacheCap() int + func (qe *QueryEngine) ServeHTTP(response http.ResponseWriter, request *http.Request) + func (qe *QueryEngine) SetQueryPlanCacheCap(size int) + type QueryExecutor struct + func (qre *QueryExecutor) Execute() (reply *sqltypes.Result, err error) + func (qre *QueryExecutor) MessageStream(callback func(*sqltypes.Result) error) error + func (qre *QueryExecutor) Stream(callback func(*sqltypes.Result) error) error + type QueryList struct + func NewQueryList() *QueryList + func (ql *QueryList) Add(qd *QueryDetail) + func (ql *QueryList) GetQueryzRows() []QueryDetailzRow + func (ql *QueryList) Remove(qd *QueryDetail) + func (ql *QueryList) Terminate(connID int64) error + func (ql *QueryList) TerminateAll() + type ReplicationWatcher struct + func NewReplicationWatcher(vs VStreamer, config tabletenv.TabletConfig) *ReplicationWatcher + func (rpw *ReplicationWatcher) Close() + func (rpw *ReplicationWatcher) Open() + func (rpw *ReplicationWatcher) Process(ctx context.Context) + type TabletPlan struct + Authorized []*tableacl.ACLResult + ErrorCount int64 + Fields []*querypb.Field + MysqlTime time.Duration + QueryCount int64 + RowCount int64 + Rules *rules.Rules + Time time.Duration + func (*TabletPlan) Size() int + func (ep *TabletPlan) AddStats(queryCount int64, duration, mysqlTime time.Duration, ...) + func (ep *TabletPlan) Stats() (queryCount int64, duration, mysqlTime time.Duration, ...) + type TabletServer struct + QueryTimeout sync2.AtomicDuration + TerseErrors bool + func NewServer(topoServer *topo.Server, alias topodatapb.TabletAlias) *TabletServer + func NewTabletServer(config tabletenv.TabletConfig, topoServer *topo.Server, ...) *TabletServer + func (tsv *TabletServer) AddStatusPart() + func (tsv *TabletServer) Begin(ctx context.Context, target *querypb.Target, options *querypb.ExecuteOptions) (transactionID int64, err error) + func (tsv *TabletServer) BeginExecute(ctx context.Context, target *querypb.Target, sql string, ...) (*sqltypes.Result, int64, error) + func (tsv *TabletServer) BeginExecuteBatch(ctx context.Context, target *querypb.Target, queries []*querypb.BoundQuery, ...) ([]sqltypes.Result, int64, error) + func (tsv *TabletServer) BroadcastHealth(terTimestamp int64, stats *querypb.RealtimeStats, maxCache time.Duration) + func (tsv *TabletServer) CheckMySQL() + func (tsv *TabletServer) ClearQueryPlanCache() + func (tsv *TabletServer) Close(ctx context.Context) error + func (tsv *TabletServer) Commit(ctx context.Context, target *querypb.Target, transactionID int64) (err error) + func (tsv *TabletServer) CommitPrepared(ctx context.Context, target *querypb.Target, dtid string) (err error) + func (tsv *TabletServer) ConcludeTransaction(ctx context.Context, target *querypb.Target, dtid string) (err error) + func (tsv *TabletServer) CreateTransaction(ctx context.Context, target *querypb.Target, dtid string, ...) (err error) + func (tsv *TabletServer) EnterLameduck() + func (tsv *TabletServer) Execute(ctx context.Context, target *querypb.Target, sql string, ...) (result *sqltypes.Result, err error) + func (tsv *TabletServer) ExecuteBatch(ctx context.Context, target *querypb.Target, queries []*querypb.BoundQuery, ...) (results []sqltypes.Result, err error) + func (tsv *TabletServer) ExitLameduck() + func (tsv *TabletServer) GetQueryPoolTimeout() time.Duration + func (tsv *TabletServer) GetQueryPoolWaiterCap() int64 + func (tsv *TabletServer) GetState() string + func (tsv *TabletServer) GetTxPoolWaiterCap() int64 + func (tsv *TabletServer) HandlePanic(err *error) + func (tsv *TabletServer) HeartbeatLag() (time.Duration, error) + func (tsv *TabletServer) InitACL(tableACLConfigFile string, enforceTableACLConfig bool, ...) + func (tsv *TabletServer) InitDBConfig(target querypb.Target, dbcfgs *dbconfigs.DBConfigs) error + func (tsv *TabletServer) IsHealthy() error + func (tsv *TabletServer) IsServing() bool + func (tsv *TabletServer) MaxDMLRows() int + func (tsv *TabletServer) MaxResultSize() int + func (tsv *TabletServer) MessageAck(ctx context.Context, target *querypb.Target, name string, ids []*querypb.Value) (count int64, err error) + func (tsv *TabletServer) MessageStream(ctx context.Context, target *querypb.Target, name string, ...) (err error) + func (tsv *TabletServer) PoolSize() int + func (tsv *TabletServer) PostponeMessages(ctx context.Context, target *querypb.Target, name string, ids []string) (count int64, err error) + func (tsv *TabletServer) Prepare(ctx context.Context, target *querypb.Target, transactionID int64, dtid string) (err error) + func (tsv *TabletServer) PurgeMessages(ctx context.Context, target *querypb.Target, name string, timeCutoff int64) (count int64, err error) + func (tsv *TabletServer) QueryPlanCacheCap() int + func (tsv *TabletServer) QueryService() queryservice.QueryService + func (tsv *TabletServer) ReadTransaction(ctx context.Context, target *querypb.Target, dtid string) (metadata *querypb.TransactionMetadata, err error) + func (tsv *TabletServer) Register() + func (tsv *TabletServer) RegisterQueryRuleSource(ruleSource string) + func (tsv *TabletServer) ReloadSchema(ctx context.Context) error + func (tsv *TabletServer) Rollback(ctx context.Context, target *querypb.Target, transactionID int64) (err error) + func (tsv *TabletServer) RollbackPrepared(ctx context.Context, target *querypb.Target, dtid string, originalID int64) (err error) + func (tsv *TabletServer) SchemaEngine() *schema.Engine + func (tsv *TabletServer) SetConsolidatorEnabled(enabled bool) + func (tsv *TabletServer) SetConsolidatorReplicasEnabled(enabled bool) + func (tsv *TabletServer) SetMaxDMLRows(val int) + func (tsv *TabletServer) SetMaxResultSize(val int) + func (tsv *TabletServer) SetPassthroughDMLs(val bool) + func (tsv *TabletServer) SetPoolSize(val int) + func (tsv *TabletServer) SetQueryPlanCacheCap(val int) + func (tsv *TabletServer) SetQueryPoolTimeout(val time.Duration) + func (tsv *TabletServer) SetQueryPoolWaiterCap(val int64) + func (tsv *TabletServer) SetQueryRules(ruleSource string, qrs *rules.Rules) error + func (tsv *TabletServer) SetRollback(ctx context.Context, target *querypb.Target, dtid string, transactionID int64) (err error) + func (tsv *TabletServer) SetServingType(tabletType topodatapb.TabletType, serving bool, ...) (stateChanged bool, err error) + func (tsv *TabletServer) SetStreamPoolSize(val int) + func (tsv *TabletServer) SetTxPoolSize(val int) + func (tsv *TabletServer) SetTxPoolTimeout(val time.Duration) + func (tsv *TabletServer) SetTxPoolWaiterCap(val int64) + func (tsv *TabletServer) SetTxTimeout(val time.Duration) + func (tsv *TabletServer) SetWarnResultSize(val int) + func (tsv *TabletServer) StartCommit(ctx context.Context, target *querypb.Target, transactionID int64, dtid string) (err error) + func (tsv *TabletServer) StartService(target querypb.Target, dbcfgs *dbconfigs.DBConfigs) (err error) + func (tsv *TabletServer) StopService() + func (tsv *TabletServer) StreamExecute(ctx context.Context, target *querypb.Target, sql string, ...) (err error) + func (tsv *TabletServer) StreamHealth(ctx context.Context, callback func(*querypb.StreamHealthResponse) error) error + func (tsv *TabletServer) StreamPoolSize() int + func (tsv *TabletServer) TopoServer() *topo.Server + func (tsv *TabletServer) TxPoolSize() int + func (tsv *TabletServer) TxPoolTimeout() time.Duration + func (tsv *TabletServer) TxTimeout() time.Duration + func (tsv *TabletServer) UnRegisterQueryRuleSource(ruleSource string) + func (tsv *TabletServer) VStream(ctx context.Context, target *querypb.Target, startPos string, ...) error + func (tsv *TabletServer) VStreamResults(ctx context.Context, target *querypb.Target, query string, ...) error + func (tsv *TabletServer) VStreamRows(ctx context.Context, target *querypb.Target, query string, ...) error + func (tsv *TabletServer) WarnResultSize() int + type TwoPC struct + func NewTwoPC(readPool *connpool.Pool) *TwoPC + func (tpc *TwoPC) Close() + func (tpc *TwoPC) CountUnresolvedRedo(ctx context.Context, unresolvedTime time.Time) (int64, error) + func (tpc *TwoPC) CreateTransaction(ctx context.Context, conn *TxConnection, dtid string, ...) error + func (tpc *TwoPC) DeleteRedo(ctx context.Context, conn *TxConnection, dtid string) error + func (tpc *TwoPC) DeleteTransaction(ctx context.Context, conn *TxConnection, dtid string) error + func (tpc *TwoPC) Init(sidecarDBName string, dbaparams dbconfigs.Connector) error + func (tpc *TwoPC) Open(dbconfigs *dbconfigs.DBConfigs) + func (tpc *TwoPC) ReadAbandoned(ctx context.Context, abandonTime time.Time) (map[string]time.Time, error) + func (tpc *TwoPC) ReadAllRedo(ctx context.Context) (prepared, failed []*PreparedTx, err error) + func (tpc *TwoPC) ReadAllTransactions(ctx context.Context) ([]*DistributedTx, error) + func (tpc *TwoPC) ReadTransaction(ctx context.Context, dtid string) (*querypb.TransactionMetadata, error) + func (tpc *TwoPC) SaveRedo(ctx context.Context, conn *TxConnection, dtid string, queries []string) error + func (tpc *TwoPC) Transition(ctx context.Context, conn *TxConnection, dtid string, ...) error + func (tpc *TwoPC) UpdateRedo(ctx context.Context, conn *TxConnection, dtid string, state int) error + type TxConnection struct + Autocommit bool + Conclusion string + EffectiveCallerID *vtrpcpb.CallerID + EndTime time.Time + ImmediateCallerID *querypb.VTGateCallerID + LogToFile sync2.AtomicInt32 + Queries []string + StartTime time.Time + TransactionID int64 + func (txc *TxConnection) BeginAgain(ctx context.Context) error + func (txc *TxConnection) Close() + func (txc *TxConnection) EventTime() time.Time + func (txc *TxConnection) Exec(ctx context.Context, query string, maxrows int, wantfields bool) (*sqltypes.Result, error) + func (txc *TxConnection) Format(params url.Values) string + func (txc *TxConnection) RecordQuery(query string) + func (txc *TxConnection) Recycle() + type TxEngine struct + func NewTxEngine(checker connpool.MySQLChecker, config tabletenv.TabletConfig) *TxEngine + func (te *TxEngine) AcceptReadOnly() error + func (te *TxEngine) AcceptReadWrite() error + func (te *TxEngine) Begin(ctx context.Context, options *querypb.ExecuteOptions) (int64, string, error) + func (te *TxEngine) Commit(ctx context.Context, transactionID int64) (string, error) + func (te *TxEngine) Init() error + func (te *TxEngine) InitDBConfig(dbcfgs *dbconfigs.DBConfigs) + func (te *TxEngine) Rollback(ctx context.Context, transactionID int64) error + func (te *TxEngine) Stop() error + func (te *TxEngine) StopGently() + type TxExecutor struct + func (txe *TxExecutor) CommitPrepared(dtid string) error + func (txe *TxExecutor) ConcludeTransaction(dtid string) error + func (txe *TxExecutor) CreateTransaction(dtid string, participants []*querypb.Target) error + func (txe *TxExecutor) Prepare(transactionID int64, dtid string) error + func (txe *TxExecutor) ReadTransaction(dtid string) (*querypb.TransactionMetadata, error) + func (txe *TxExecutor) ReadTwopcInflight() (distributed []*DistributedTx, prepared, failed []*PreparedTx, err error) + func (txe *TxExecutor) RollbackPrepared(dtid string, originalID int64) error + func (txe *TxExecutor) SetRollback(dtid string, transactionID int64) error + func (txe *TxExecutor) StartCommit(transactionID int64, dtid string) error + type TxPool struct + func NewTxPool(prefix string, capacity int, foundRowsCapacity int, prefillParallelism int, ...) *TxPool + func (axp *TxPool) AdjustLastID(id int64) + func (axp *TxPool) Begin(ctx context.Context, options *querypb.ExecuteOptions) (int64, string, error) + func (axp *TxPool) Close() + func (axp *TxPool) Commit(ctx context.Context, transactionID int64) (string, error) + func (axp *TxPool) Get(transactionID int64, reason string) (*TxConnection, error) + func (axp *TxPool) LocalBegin(ctx context.Context, options *querypb.ExecuteOptions) (*TxConnection, string, error) + func (axp *TxPool) LocalCommit(ctx context.Context, conn *TxConnection) (string, error) + func (axp *TxPool) LocalConclude(ctx context.Context, conn *TxConnection) + func (axp *TxPool) LogActive() + func (axp *TxPool) Open(appParams, dbaParams, appDebugParams dbconfigs.Connector) + func (axp *TxPool) PoolTimeout() time.Duration + func (axp *TxPool) Rollback(ctx context.Context, transactionID int64) error + func (axp *TxPool) RollbackNonBusy(ctx context.Context) + func (axp *TxPool) SetPoolTimeout(timeout time.Duration) + func (axp *TxPool) SetTimeout(timeout time.Duration) + func (axp *TxPool) Timeout() time.Duration + func (axp *TxPool) WaitForEmpty() + type TxPreparedPool struct + func NewTxPreparedPool(capacity int) *TxPreparedPool + func (pp *TxPreparedPool) FetchAll() []*TxConnection + func (pp *TxPreparedPool) FetchForCommit(dtid string) (*TxConnection, error) + func (pp *TxPreparedPool) FetchForRollback(dtid string) *TxConnection + func (pp *TxPreparedPool) Forget(dtid string) + func (pp *TxPreparedPool) Put(c *TxConnection, dtid string) error + func (pp *TxPreparedPool) SetFailed(dtid string) + type VStreamer interface + Stream func(ctx context.Context, startPos string, filter *binlogdatapb.Filter, ...) error