recover

package
v0.0.0-...-4957362 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDatabaseBackup

func CreateDatabaseBackup(filesystem *sys.OS) error

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

func MaybeUnpackRecoveryTarball(filesystem *sys.OS) error

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

func RecoverFromQuorumLoss(filesystem *sys.OS, members []cluster.DqliteMember) (string, error)

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.

Jump to

Keyboard shortcuts

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