restore

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	/*
	 * Used for synchronizing DoCleanup.  In DoInit() we increment the group
	 * and then wait for at least one DoCleanup to finish, either in DoTeardown
	 * or the signal handler.
	 */
	CleanupGroup *sync.WaitGroup
)

Functions

func BackupConfigurationValidation

func BackupConfigurationValidation()

func BatchPostdataStatements

func BatchPostdataStatements(statements []toc.StatementWithType) ([]toc.StatementWithType, []toc.StatementWithType, []toc.StatementWithType)

* There is an existing bug in Greenplum where creating indexes in parallel * on an AO table that didn't have any indexes previously can cause * deadlock. * * We work around this issue by restoring post data objects in * two batches. The first batch takes one index from each table and * restores them in parallel (which has no possibility of deadlock) and * then the second restores all other postdata objects in parallel. After * each table has at least one index, there is no more risk of deadlock. * * A third batch is created specifically for postdata metadata * (e.g. ALTER INDEX, ALTER EVENT TRIGGER, COMMENT ON). These * statements cannot be concurrently run with batch two since that * is where the dependent postdata objects are being created.

func CheckRowsRestored

func CheckRowsRestored(rowsRestored int64, rowsBackedUp int64, tableName string) error

func CopyTableIn

func CopyTableIn(connectionPool *dbconn.DBConn, tableName string, tableAttributes string, destinationToRead string, singleDataFile bool, whichConn int) (int64, error)

func CreateConnectionPool

func CreateConnectionPool(unquotedDBName string)

func CreateInitialSegmentPipes

func CreateInitialSegmentPipes(oidList []string, c *cluster.Cluster, connectionPool *dbconn.DBConn, fpInfo filepath.FilePathInfo) int

func DoCleanup

func DoCleanup(restoreFailed bool)

func DoInit

func DoInit(cmd *cobra.Command)

This function handles setup that can be done before parsing flags.

func DoRestore

func DoRestore()

func DoSetup

func DoSetup()

This function handles setup that must be done after parsing flags.

func DoTeardown

func DoTeardown()

func DoValidation

func DoValidation(cmd *cobra.Command)

* This function handles argument parsing and validation, e.g. checking that a passed filename exists. * It should only validate; initialization with any sort of side effects should go in DoInit or DoSetup.

func ExecuteRestoreMetadataStatements

func ExecuteRestoreMetadataStatements(statements []toc.StatementWithType, objectsTitle string, progressBar utils.ProgressBar, showProgressBar int, executeInParallel bool) int32

func ExecuteStatements

func ExecuteStatements(statements []toc.StatementWithType, progressBar utils.ProgressBar, executeInParallel bool, whichConn ...int) int32

* This function creates a worker pool of N goroutines to be able to execute up * to N statements in parallel.

func ExecuteStatementsAndCreateProgressBar

func ExecuteStatementsAndCreateProgressBar(statements []toc.StatementWithType, objectsTitle string, showProgressBar int, executeInParallel bool, whichConn ...int) int32

func ExpandReplicatedTable

func ExpandReplicatedTable(origSize int, tableName string, whichConn int) error

func FindHistoricalPluginVersion

func FindHistoricalPluginVersion(timestamp string) string

func FlagChanged

func FlagChanged(flagName string) bool

func GenerateRestoreRelationList

func GenerateRestoreRelationList(opts options.Options) []string

func GetBackupFPInfoForTimestamp

func GetBackupFPInfoForTimestamp(timestamp string) filepath.FilePathInfo

func GetBackupFPInfoListFromRestorePlan

func GetBackupFPInfoListFromRestorePlan() []filepath.FilePathInfo

func GetExistingSchemas

func GetExistingSchemas() ([]string, error)

func GetExistingTableFQNs

func GetExistingTableFQNs() ([]string, error)

func GetResizeClusterInfo

func GetResizeClusterInfo() (int, int, bool)

func GetRestoreMetadataStatements

func GetRestoreMetadataStatements(section string, filename string, includeObjectTypes []string, excludeObjectTypes []string) []toc.StatementWithType

func GetRestoreMetadataStatementsFiltered

func GetRestoreMetadataStatementsFiltered(section string, filename string, includeObjectTypes []string, excludeObjectTypes []string, filters Filters) []toc.StatementWithType

func GetVersion

func GetVersion() string

func InitializeBackupConfig

func InitializeBackupConfig()

func InitializeConnectionPool

func InitializeConnectionPool(backupTimestamp string, restoreTimestamp string, unquotedDBName string)

func MustGetFlagBool

func MustGetFlagBool(flagName string) bool

func MustGetFlagInt

func MustGetFlagInt(flagName string) int

func MustGetFlagString

func MustGetFlagString(flagName string) string

func MustGetFlagStringArray

func MustGetFlagStringArray(flagName string) []string

func MustGetFlagStringSlice

func MustGetFlagStringSlice(flagName string) []string

func RecoverMetadataFilesUsingPlugin

func RecoverMetadataFilesUsingPlugin()

func RedistributeTableData

func RedistributeTableData(tableName string, whichConn int) error

func RestoreSchemas

func RestoreSchemas(schemaStatements []toc.StatementWithType, progressBar utils.ProgressBar)

func SetBackupConfig

func SetBackupConfig(config *history.BackupConfig)

func SetCluster

func SetCluster(cluster *cluster.Cluster)

func SetCmdFlags

func SetCmdFlags(flagSet *pflag.FlagSet)

func SetConnection

func SetConnection(conn *dbconn.DBConn)

func SetFPInfo

func SetFPInfo(fpInfo filepath.FilePathInfo)

func SetLoggerVerbosity

func SetLoggerVerbosity()

func SetMaxCsvLineLengthQuery

func SetMaxCsvLineLengthQuery(connectionPool *dbconn.DBConn) string

func SetPluginConfig

func SetPluginConfig(config *utils.PluginConfig)

func SetRestorePlanForLegacyBackup

func SetRestorePlanForLegacyBackup(toc *toc.TOC, backupTimestamp string, backupConfig *history.BackupConfig)

func SetTOC

func SetTOC(toc *toc.TOC)

func SetVersion

func SetVersion(v string)

func TruncateTable

func TruncateTable(tableFQN string, whichConn int) error

func ValidateBackupFlagCombinations

func ValidateBackupFlagCombinations()

func ValidateDatabaseExistence

func ValidateDatabaseExistence(unquotedDBName string, createDatabase bool, isFiltered bool)

func ValidateExcludeRelationsInBackupSet

func ValidateExcludeRelationsInBackupSet(schemaList []string)

func ValidateExcludeSchemasInBackupSet

func ValidateExcludeSchemasInBackupSet(schemaList []string)

func ValidateFlagCombinations

func ValidateFlagCombinations(flags *pflag.FlagSet)

func ValidateIncludeRelationsInBackupSet

func ValidateIncludeRelationsInBackupSet(schemaList []string)

func ValidateIncludeSchemasInBackupSet

func ValidateIncludeSchemasInBackupSet(schemaList []string)

func ValidateRedirectSchema

func ValidateRedirectSchema(connectionPool *dbconn.DBConn, redirectSchema string)

func ValidateRelationsInRestoreDatabase

func ValidateRelationsInRestoreDatabase(connectionPool *dbconn.DBConn, relationList []string)

func ValidateSafeToResizeCluster

func ValidateSafeToResizeCluster()

func VerifyBackupDirectoriesExistOnAllHosts

func VerifyBackupDirectoriesExistOnAllHosts()

func VerifyBackupFileCountOnSegments

func VerifyBackupFileCountOnSegments()

func VerifyMetadataFilePaths

func VerifyMetadataFilePaths(withStats bool)

Types

type Empty

type Empty struct{}

* Empty struct type used for value with 0 bytes

type Filters

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

* Filter structure to filter schemas and relations

func NewFilters

func NewFilters(inSchema []string, exSchemas []string, inRelations []string, exRelations []string) Filters

Jump to

Keyboard shortcuts

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