Documentation ¶
Index ¶
- Constants
- Variables
- func JWKSHandlerInterceptor(keyID string, pub ed25519.PublicKey) func(http.Handler) http.Handler
- func JWTExpectations() jwt.Expected
- func NewInitDatabaseHook(controller *Controller, bt *sql.BackgroundThreads) sqle.InitDatabaseHook
- type Attempt
- type BranchControlPersistence
- type Controller
- func (c *Controller) ApplyStandbyReplicationConfig(ctx context.Context, bt *sql.BackgroundThreads, mrEnv *env.MultiRepoEnv, ...) error
- func (c *Controller) ClusterDatabase() sql.Database
- func (c *Controller) DropDatabaseHook() func(*sql.Context, string)
- func (c *Controller) GetClusterStatus() []clusterdb.ReplicaStatus
- func (c *Controller) GracefulStop() error
- func (c *Controller) HookBranchControlPersistence(controller *branch_control.Controller, fs filesys.Filesys)
- func (c *Controller) HookMySQLDbPersister(persister MySQLDbPersister, mysqlDb *mysql_db.MySQLDb) MySQLDbPersister
- func (c *Controller) ManageQueryConnections(iterSessions IterSessions, killQuery func(uint32), ...)
- func (c *Controller) ManageSystemVariables(variables sqlvars)
- func (c *Controller) RegisterGrpcServices(ctxFactory func(context.Context) (*sql.Context, error), srv *grpc.Server)
- func (c *Controller) RegisterStoredProcedures(store procedurestore)
- func (c *Controller) RemoteSrvListenAddr() string
- func (c *Controller) RemoteSrvServerArgs(ctxFactory func(context.Context) (*sql.Context, error), ...) (remotesrv.ServerArgs, error)
- func (c *Controller) Run()
- func (c *Controller) ServerOptions() []grpc.ServerOption
- func (c *Controller) SetDropDatabase(dropDatabase func(*sql.Context, string) error)
- func (c *Controller) SetIsStandbyCallback(callback IsStandbyCallback)
- type IsStandbyCallback
- type IterSessions
- type JWKSHandler
- type MySQLDbPersister
- type ProgressNotifier
- type Role
Constants ¶
const (
// Since we fetch the keys from the other replicas we’re going to use a fixed string here.
DoltClusterRemoteApiAudience = "dolt-cluster-remote-api.dolthub.com"
)
const PersistentConfigPrefix = "sqlserver.cluster"
Variables ¶
var ErrServerTransitionedRolesErr = errors.New("this server transitioned cluster roles. this connection can no longer be used. please reconnect.")
Functions ¶
func JWKSHandlerInterceptor ¶
func JWTExpectations ¶
func NewInitDatabaseHook ¶
func NewInitDatabaseHook(controller *Controller, bt *sql.BackgroundThreads) sqle.InitDatabaseHook
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(lgr *logrus.Logger, cfg servercfg.ClusterConfig, pCfg config.ReadWriteConfig) (*Controller, error)
func (*Controller) ApplyStandbyReplicationConfig ¶
func (c *Controller) ApplyStandbyReplicationConfig(ctx context.Context, bt *sql.BackgroundThreads, mrEnv *env.MultiRepoEnv, dbs ...dsess.SqlDatabase) error
func (*Controller) ClusterDatabase ¶
func (c *Controller) ClusterDatabase() sql.Database
func (*Controller) DropDatabaseHook ¶
func (c *Controller) DropDatabaseHook() func(*sql.Context, string)
DropDatabaseHook gets called when the database provider drops a database. This is how we learn that we need to replicate a drop database.
func (*Controller) GetClusterStatus ¶
func (c *Controller) GetClusterStatus() []clusterdb.ReplicaStatus
func (*Controller) GracefulStop ¶
func (c *Controller) GracefulStop() error
func (*Controller) HookBranchControlPersistence ¶
func (c *Controller) HookBranchControlPersistence(controller *branch_control.Controller, fs filesys.Filesys)
func (*Controller) HookMySQLDbPersister ¶
func (c *Controller) HookMySQLDbPersister(persister MySQLDbPersister, mysqlDb *mysql_db.MySQLDb) MySQLDbPersister
func (*Controller) ManageQueryConnections ¶
func (c *Controller) ManageQueryConnections(iterSessions IterSessions, killQuery func(uint32), killConnection func(uint32) error)
func (*Controller) ManageSystemVariables ¶
func (c *Controller) ManageSystemVariables(variables sqlvars)
func (*Controller) RegisterGrpcServices ¶
func (*Controller) RegisterStoredProcedures ¶
func (c *Controller) RegisterStoredProcedures(store procedurestore)
func (*Controller) RemoteSrvListenAddr ¶
func (c *Controller) RemoteSrvListenAddr() string
func (*Controller) RemoteSrvServerArgs ¶
func (c *Controller) RemoteSrvServerArgs(ctxFactory func(context.Context) (*sql.Context, error), args remotesrv.ServerArgs) (remotesrv.ServerArgs, error)
func (*Controller) Run ¶
func (c *Controller) Run()
func (*Controller) ServerOptions ¶
func (c *Controller) ServerOptions() []grpc.ServerOption
func (*Controller) SetDropDatabase ¶
func (c *Controller) SetDropDatabase(dropDatabase func(*sql.Context, string) error)
Incoming drop database replication requests need a way to drop a database in the sqle.DatabaseProvider. This is our callback for that functionality.
func (*Controller) SetIsStandbyCallback ¶
func (c *Controller) SetIsStandbyCallback(callback IsStandbyCallback)
type IsStandbyCallback ¶
type IsStandbyCallback func(bool)
Our IsStandbyCallback gets called with |true| or |false| when the server becomes a standby or a primary respectively. Standby replicas should be read only.
type JWKSHandler ¶
func (JWKSHandler) ServeHTTP ¶
func (h JWKSHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type MySQLDbPersister ¶
type ProgressNotifier ¶
type ProgressNotifier struct {
// contains filtered or unexported fields
}
ProgressNotifier is a way for clients to be notified of successful progress which a monotonic agent makes after they register to receive notification by taking a callback with |Wait|.
As a monotonic agent implementation, you should call |BeginAttempt()| anytime you begin attempting to do work. If that work succeeds, you can call |RecordSuccess|. If the work fails, you must call |RecordFailure|. |RecordSuccess| makes a later call to |RecordFailure| with the same |*Attempt| a no-op, so that the call to |RecordFailure| can be safely placed in a defer block.
As a client of the agent, you can call |Wait|, which will return a function you can call to block until either progress was made since the call to |Wait| or the provided |context.Context| is |Done|. If progress is made, the function returned from |Wait| returns |nil|. If the context was canceled, it returns |context.Cause(ctx)|.
All accesses to ProgressNotifier should be externally synchronized except for calling into the functions returned by |Wait|.
func (*ProgressNotifier) BeginAttempt ¶
func (p *ProgressNotifier) BeginAttempt() *Attempt
func (*ProgressNotifier) HasWaiters ¶
func (p *ProgressNotifier) HasWaiters() bool
func (*ProgressNotifier) RecordFailure ¶
func (p *ProgressNotifier) RecordFailure(a *Attempt)
func (*ProgressNotifier) RecordSuccess ¶
func (*ProgressNotifier) RecordSuccess(a *Attempt)