Documentation
¶
Overview ¶
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
Package mysql implements the Percona Server for MySQL control-plane core.
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors
Index ¶
- func ArtifactPins(version string) (server, backup string, err error)
- func GeneratePassword() (string, error)
- func PrepareCommands(version, owner string) ([]string, error)
- func ValidateDatabaseName(name string) error
- func ValidateGrant(grant Grant) error
- func ValidatePassword(password string) error
- func ValidateUserName(name string) error
- func ValidateUserPatch(patch UserPatch) error
- func ValidateUserWrite(user UserWrite) error
- type Access
- type BinlogOptions
- type Core
- func (p *Core) ApplyDefaults(s *domain.ClusterSpec)
- func (*Core) Balancer(context.Context, *engine.Context) (domain.BalancerStatus, error)
- func (*Core) CanCancelOperation(_ context.Context, op *domain.Operation) error
- func (*Core) CanClaimOperation(c *domain.Cluster) (bool, error)
- func (p *Core) CancelOperation(_ context.Context, rc *engine.Context, op *domain.Operation) (engine.OpResult, error)
- func (p *Core) Cleanup(ctx context.Context, rc *engine.Context, opts domain.DeleteOptions) (done bool, err error)
- func (p *Core) Connection(ctx context.Context, rc *engine.Context) (domain.ConnectionDetails, error)
- func (p *Core) CreateDatabase(ctx context.Context, rc *engine.Context, db Database) error
- func (*Core) CreateDatabaseRole(context.Context, *engine.Context, domain.DatabaseRole) error
- func (*Core) CreateDatabaseUser(context.Context, *engine.Context, domain.DatabaseUser, string) (string, error)
- func (p *Core) CreateUser(ctx context.Context, rc *engine.Context, user UserWrite) (string, error)
- func (*Core) DataMembers(c *domain.Cluster) []string
- func (p *Core) DeleteDatabase(ctx context.Context, rc *engine.Context, name string, force bool) error
- func (*Core) DeleteDatabaseRole(context.Context, *engine.Context, string, string) error
- func (*Core) DeleteDatabaseUser(context.Context, *engine.Context, string, string) error
- func (p *Core) DeleteRetainedBackup(ctx context.Context, storage domain.BackupStorage, b domain.Backup) error
- func (p *Core) DeleteUser(ctx context.Context, rc *engine.Context, name string) error
- func (p *Core) Describe() domain.ProviderInfo
- func (p *Core) DiscardOldPassword(ctx context.Context, rc *engine.Context, name string) error
- func (p *Core) EnqueueFullBackup(ctx context.Context, rc *engine.Context, key string) error
- func (*Core) FilterRetention(backups, candidates []domain.Backup) []domain.Backup
- func (p *Core) GetDatabase(ctx context.Context, rc *engine.Context, name string) (*Database, error)
- func (*Core) GetDatabaseRole(context.Context, *engine.Context, string, string) (*domain.DatabaseRole, error)
- func (*Core) GetDatabaseUser(context.Context, *engine.Context, string, string) (*domain.DatabaseUser, error)
- func (p *Core) GetUser(ctx context.Context, rc *engine.Context, name string) (*User, error)
- func (p *Core) Grant(ctx context.Context, rc *engine.Context, grant Grant) error
- func (*Core) InitialDataSourceApplied(c *domain.Cluster) (bool, error)
- func (*Core) ListDatabaseRoles(context.Context, *engine.Context) ([]domain.DatabaseRole, error)
- func (*Core) ListDatabaseUsers(context.Context, *engine.Context) ([]domain.DatabaseUser, error)
- func (p *Core) ListDatabases(ctx context.Context, rc *engine.Context) ([]Database, error)
- func (p *Core) ListGrants(ctx context.Context, rc *engine.Context, user, database string) ([]Grant, error)
- func (p *Core) ListUsers(ctx context.Context, rc *engine.Context) ([]User, error)
- func (p *Core) MemberConfig(ctx context.Context, rc *engine.Context, name string) (agentapi.MemberConfig, error)
- func (*Core) MemberLogs(ctx context.Context, rc *engine.Context, name, process string, lines int) ([]domain.MemberLogLine, error)
- func (*Core) Metrics() []domain.MetricDescriptor
- func (p *Core) Name() string
- func (p *Core) PITRWindow(ctx context.Context, rc *engine.Context) ([]domain.TimeWindow, error)
- func (p *Core) PatchUser(ctx context.Context, rc *engine.Context, name string, patch UserPatch) error
- func (p *Core) Placement(ctx context.Context, rc *engine.Context) (domain.Placement, error)
- func (*Core) RelayTargets(c *domain.Cluster) []string
- func (*Core) RequiredCapabilities(s domain.ClusterSpec) []string
- func (p *Core) Revoke(ctx context.Context, rc *engine.Context, grant Grant) error
- func (p *Core) RotateUserPassword(ctx context.Context, rc *engine.Context, name string, retain bool) (string, error)
- func (p *Core) RunOperation(ctx context.Context, rc *engine.Context, op *domain.Operation) (engine.OpResult, error)
- func (*Core) SetBalancer(context.Context, *engine.Context, bool) error
- func (p *Core) Status(ctx context.Context, rc *engine.Context) (status domain.ClusterStatus, err error)
- func (*Core) SupportsFailureCleanup(op *domain.Operation) bool
- func (p *Core) Sync(ctx context.Context, rc *engine.Context) (result engine.Result, err error)
- func (*Core) SyncDuringOperation(op *domain.Operation) bool
- func (*Core) SystemUsers(context.Context, *engine.Context) ([]domain.SystemUser, error)
- func (*Core) UpdateDatabaseRole(context.Context, *engine.Context, domain.DatabaseRole) error
- func (*Core) UpdateDatabaseUser(context.Context, *engine.Context, domain.DatabaseUser, string) error
- func (p *Core) UpgradeBackupReady(ctx context.Context, c *domain.Cluster, secrets engine.SecretStore) bool
- func (p *Core) Validate(ctx context.Context, old, n *domain.Cluster) error
- func (p *Core) ValidateBackup(ctx context.Context, rc *engine.Context, backupType string) error
- func (*Core) ValidateDatabasePassword(password string) error
- func (p *Core) ValidatePITRRestore(ctx context.Context, rc *engine.Context, target time.Time) ([]domain.TimeWindow, error)
- func (*Core) VolumeReferences(c *domain.Cluster) ([]engine.VolumeReference, error)
- type Database
- type EngineOptions
- type Grant
- type GroupReplicationOptions
- type Options
- type ProxyOptions
- type User
- type UserPatch
- type UserWrite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArtifactPins ¶
ArtifactPins resolves a supported server release to its immutable server and backup catalog keys.
func GeneratePassword ¶
func PrepareCommands ¶
PrepareCommands verifies and installs the locked server and matching backup tools.
func ValidateDatabaseName ¶
func ValidateGrant ¶
func ValidatePassword ¶
func ValidateUserName ¶
func ValidateUserPatch ¶
func ValidateUserWrite ¶
Types ¶
type Access ¶
type Access interface {
ListUsers(context.Context, *engine.Context) ([]User, error)
GetUser(context.Context, *engine.Context, string) (*User, error)
CreateUser(context.Context, *engine.Context, UserWrite) (string, error)
PatchUser(context.Context, *engine.Context, string, UserPatch) error
DeleteUser(context.Context, *engine.Context, string) error
RotateUserPassword(context.Context, *engine.Context, string, bool) (string, error)
DiscardOldPassword(context.Context, *engine.Context, string) error
ListDatabases(context.Context, *engine.Context) ([]Database, error)
GetDatabase(context.Context, *engine.Context, string) (*Database, error)
CreateDatabase(context.Context, *engine.Context, Database) error
DeleteDatabase(context.Context, *engine.Context, string, bool) error
ListGrants(context.Context, *engine.Context, string, string) ([]Grant, error)
Grant(context.Context, *engine.Context, Grant) error
Revoke(context.Context, *engine.Context, Grant) error
}
Access is the native MySQL account API, also shared by compatible providers.
Implementations must resolve the live writable member on every call and send bounded AccessRequests to /v1/mysql/access-{users,databases,grants}. All users are at host '%' and REQUIRE SSL. Hidden native accounts/schemas cannot be read or changed. RoutableThroughProxy is true only for accounts whose current credentials are owned by the sealed managed-user index, never for SQL-created accounts discovered by observation.
Before any user mutation, seal a pending intent containing the exact request, any generated password, stable random RequestID, prior credential/index snapshot, and intended proxy revision. Never put these secrets in cluster state, logs, operation status, or receipts. Replay this SAME intent until the member's AccessResult proves applied or rejected; an unknown outcome preserves it and blocks subsequent credential mutations. MySQL account DDL implicitly commits: the member atomically attaches an operation marker to the account DDL and reconciles its receipt table from that marker, not a fictitious SQL transaction. After application, seal current (and retained secondary, if requested) credentials and managed-user index before publishing the matching ProxySQL configuration revision. Resume interrupted publication before new mutations. Definitive rejection restores the prior sealed snapshot. Creation must not adopt a foreign native account. Retained passwords require both credentials to remain usable through every proxy until discard completes; reject the operation before SQL if the deployed proxy cannot represent that contract. Delete waits for its durable account tombstone before removing sealed credentials and the managed index and publishing a new proxy revision. Pending deletion can drop only the original native marker; an applied tombstone never removes a subsequently recreated account. Serialize access mutations with lifecycle changes, and never report success before required proxy configuration acknowledgements.
CreateUser returns the generated password (empty when supplied by the caller). RotateUserPassword always returns the new generated password exactly once. DeleteDatabase refuses a nonempty database unless force is true. ListGrants requires at least one of the user and database filters.
type BinlogOptions ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
func (*Core) ApplyDefaults ¶
func (p *Core) ApplyDefaults(s *domain.ClusterSpec)
func (*Core) CanCancelOperation ¶
func (*Core) CancelOperation ¶
func (p *Core) CancelOperation(_ context.Context, rc *engine.Context, op *domain.Operation) (engine.OpResult, error)
CancelOperation is also invoked for terminal queue failure. The saved source, group UUID and receipt remain owned by reconciliation rather than un-fencing partially restored data or choosing another source after a crash.
func (*Core) Connection ¶
func (*Core) CreateDatabase ¶
func (*Core) CreateDatabaseRole ¶
func (*Core) CreateDatabaseUser ¶
func (*Core) CreateUser ¶
func (*Core) DeleteDatabase ¶
func (*Core) DeleteDatabaseRole ¶
func (*Core) DeleteDatabaseUser ¶
func (*Core) DeleteRetainedBackup ¶
func (*Core) DeleteUser ¶
func (*Core) Describe ¶
func (p *Core) Describe() domain.ProviderInfo
func (*Core) DiscardOldPassword ¶
func (*Core) EnqueueFullBackup ¶
func (*Core) FilterRetention ¶
func (*Core) GetDatabase ¶
func (*Core) GetDatabaseRole ¶
func (*Core) GetDatabaseUser ¶
func (*Core) InitialDataSourceApplied ¶ added in v0.4.2
InitialDataSourceApplied reports the durable initial restore completion receipt. Native health and the observed spec generation do not establish data import.
func (*Core) ListDatabaseRoles ¶
func (*Core) ListDatabaseUsers ¶
func (*Core) ListDatabases ¶
func (*Core) ListGrants ¶
func (*Core) MemberConfig ¶
func (*Core) MemberLogs ¶
func (*Core) Metrics ¶
func (*Core) Metrics() []domain.MetricDescriptor
Metrics maps the native runner's stable vocabulary into canonical series.
func (*Core) PITRWindow ¶
func (*Core) RequiredCapabilities ¶
func (*Core) RequiredCapabilities(s domain.ClusterSpec) []string
func (*Core) RotateUserPassword ¶
func (*Core) RunOperation ¶
func (p *Core) RunOperation(ctx context.Context, rc *engine.Context, op *domain.Operation) (engine.OpResult, error)
RunOperation's closed dispatch prevents unsupported maintenance from mutating data.
func (*Core) SupportsFailureCleanup ¶
func (*Core) SyncDuringOperation ¶
Sync is excluded during queued operations. Their checkpoints alone own holds; after terminal failure the durable backup state transfers ownership to Sync.
func (*Core) SystemUsers ¶
func (*Core) UpdateDatabaseRole ¶
func (*Core) UpdateDatabaseUser ¶
func (*Core) UpgradeBackupReady ¶
func (p *Core) UpgradeBackupReady(ctx context.Context, c *domain.Cluster, secrets engine.SecretStore) bool
UpgradeBackupReady admits the prerequisite backup while a major upgrade is parked before its first side effect. The last published configuration digest must match exactly after reverting only the desired version; this is not an exception for arbitrary unobserved changes or other maintenance.
func (*Core) ValidateBackup ¶
ValidateBackup performs fresh admission independently of cached cluster phase.
func (*Core) ValidateDatabasePassword ¶
func (*Core) ValidatePITRRestore ¶
func (*Core) VolumeReferences ¶ added in v0.4.1
VolumeReferences exposes persistent identities for backend sizing observation.
type EngineOptions ¶
type EngineOptions struct {
Parameters map[string]string `json:"parameters,omitempty"`
Proxy ProxyOptions `json:"proxy,omitempty"`
GroupReplication GroupReplicationOptions `json:"groupReplication,omitempty"`
Binlog BinlogOptions `json:"binlog,omitempty"`
}
func ParseOptions ¶
func ParseOptions(raw json.RawMessage) (EngineOptions, error)
ParseOptions rejects unknown options and settings owned by the orchestrator.
type GroupReplicationOptions ¶
type ProxyOptions ¶
Source Files
¶
- access.go
- access_cleanup.go
- access_journal.go
- access_provider.go
- backup.go
- backup_access.go
- backup_cleanup.go
- backup_validation.go
- cleanup.go
- config.go
- dataplane.go
- formation.go
- galera.go
- galera_quorum.go
- galera_tls.go
- galera_tls_cleanup.go
- gtid_quorum.go
- metrics.go
- observation.go
- operations.go
- options.go
- provider.go
- proxy.go
- pxc.go
- reformation.go
- replacement.go
- restore.go
- restore_recovery.go
- retirement.go
- rolling.go
- scale.go
- secrets.go
- state.go
- status.go
- sync.go
- tls_rotation.go
- upgrade.go
- upgrade_backup_admission.go
- volume_sizes.go