Documentation ¶
Index ¶
- func CreateDatabaseBackup(filesystem *sys.OS) error
- func GetDqliteClusterMembers(filesystem *sys.OS) ([]cluster.DqliteMember, error)
- func MaybeUnpackRecoveryTarball(filesystem *sys.OS) error
- func RecoverFromQuorumLoss(filesystem *sys.OS, members []cluster.DqliteMember) (string, error)
- func ValidateMemberChanges(oldMembers []cluster.DqliteMember, newMembers []cluster.DqliteMember) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDatabaseBackup ¶
CreateDatabaseBackup writes a tarball of filesystem.DatabaseDir to filesystem.StateDir as db_backup.TIMESTAMP.tar.gz. It does not check to to ensure that the database is stopped.
func GetDqliteClusterMembers ¶
func GetDqliteClusterMembers(filesystem *sys.OS) ([]cluster.DqliteMember, error)
GetDqliteClusterMembers parses the trust store and path.Join(filesystem.DatabaseDir, "cluster.yaml").
func MaybeUnpackRecoveryTarball ¶
MaybeUnpackRecoveryTarball checks for the presence of a recovery tarball in fiesystem.StateDir. If it exists, unpack it into a temporary directory, ensure that it is a valid microcluster recovery tarball, and replace the existing filesystem.DatabaseDir.
func RecoverFromQuorumLoss ¶
RecoverFromQuorumLoss resets the dqlite raft log, rewrites the go-dqlite yaml files, modifies the daemon and trust store, and writes a recovery tarball. It does not check members to ensure that the new configuration is valid; use ValidateMemberChanges to ensure that the inputs to this function are correct.
func ValidateMemberChanges ¶
func ValidateMemberChanges(oldMembers []cluster.DqliteMember, newMembers []cluster.DqliteMember) error
ValidateMemberChanges compares two arrays of members to ensure: - Their lengths are the same. - Members with the same name also use the same ID. - There is at least one voter in newMembers. - All the newMembers addresses can be parsed to a netip.AddrPort. - There are no duplicate addresses.
Types ¶
This section is empty.