cluster

package
v0.40.5-0...-850ec4b Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const PersistentConfigPrefix = "sqlserver.cluster"

Variables

View Source
var ErrServerTransitionedRolesErr = errors.New("this server transitioned cluster roles. this connection can no longer be used. please reconnect.")

Functions

func JWKSHandlerInterceptor

func JWKSHandlerInterceptor(keyID string, pub ed25519.PublicKey) func(http.Handler) http.Handler

func JWTExpectations

func JWTExpectations() jwt.Expected

func NewInitDatabaseHook

func NewInitDatabaseHook(controller *Controller, bt *sql.BackgroundThreads) sqle.InitDatabaseHook

Types

type Attempt

type Attempt struct {
	// contains filtered or unexported fields
}

type BranchControlPersistence

type BranchControlPersistence interface {
	LoadData(context.Context, []byte, bool) error
	SaveData(context.Context, filesys.Filesys) error
}

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

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 (c *Controller) RegisterGrpcServices(ctxFactory func(context.Context) (*sql.Context, error), srv *grpc.Server)

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 IterSessions

type IterSessions func(func(sql.Session) (bool, error)) error

type JWKSHandler

type JWKSHandler struct {
	KeyID     string
	PublicKey ed25519.PublicKey
}

func (JWKSHandler) ServeHTTP

func (h JWKSHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type MySQLDbPersister

type MySQLDbPersister interface {
	mysql_db.MySQLDbPersistence
	LoadData(context.Context) ([]byte, error)
}

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)

func (*ProgressNotifier) Wait

func (p *ProgressNotifier) Wait() func(context.Context) error

type Role

type Role string
const RoleDetectedBrokenConfig Role = "detected_broken_config"
const RolePrimary Role = "primary"
const RoleStandby Role = "standby"

Jump to

Keyboard shortcuts

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