Documentation ¶
Index ¶
- Constants
- Variables
- func AddMirrorsToGpSegmentConfiguration(db *sql.DB, intermediate *greenplum.Cluster) (err error)
- func AddReplicationEntriesOnPrimaries(agentConns []*idl.Connection, intermediate *greenplum.Cluster, ...) error
- func AgentHosts(c *greenplum.Cluster) []string
- func AppendDynamicLibraryPath(intermediate *greenplum.Cluster, toAppend string) error
- func ArchiveLogDirectories(logDir string, logArchiveDir string, agentConns []*idl.Connection, ...) error
- func ArchiveSegmentLogDirectories(agentConns []*idl.Connection, excludeHostname, logArchiveDir string) error
- func CheckDiskSpace(streams step.OutStreams, agentConns []*idl.Connection, diskFreeRatio float64, ...) error
- func CheckEnvironment(agentHostsIncludingCoordinator []string, sourceGphome string, ...) error
- func CheckEnvironmentOnSegment(host string, sourceGphome string, targetGphome string) error
- func Copy(streams step.OutStreams, sourceDirs []string, ...) error
- func CopyCoordinatorDataDir(streams step.OutStreams, coordinatorDataDir string, ...) error
- func CopyCoordinatorTablespaces(streams step.OutStreams, sourceVersion semver.Version, ...) error
- func CreateBackupDirectories(streams step.OutStreams, agentConns []*idl.Connection, ...) error
- func CreateBackupDirectory(backupDir string) error
- func CreateInitialInitsystemConfig(targetCoordinatorDataDir string, useHbaHostnames bool) ([]string, error)
- func CreateRecoveryConfOnSegments(agentConns []*idl.Connection, intermediate *greenplum.Cluster) error
- func CreateReplicationSlots(db *sql.DB) error
- func DeleteBackupDirectories(streams step.OutStreams, agentConns []*idl.Connection, ...) error
- func DeleteCoordinatorAndPrimaryDataDirectories(streams step.OutStreams, agentConns []*idl.Connection, ...) error
- func DeleteStateDirectories(agentConns []*idl.Connection, excludeHostname string) error
- func DeleteTargetTablespaces(streams step.OutStreams, agentConns []*idl.Connection, ...) error
- func DeleteTargetTablespacesOnCoordinator(streams step.OutStreams, target *greenplum.Cluster, ...) error
- func DeleteTargetTablespacesOnPrimaries(agentConns []*idl.Connection, target *greenplum.Cluster, ...) error
- func EnsureConnsAreReady(agentConns []*idl.Connection, timeout time.Duration) error
- func ExecuteRPC(agentConns []*idl.Connection, executeRequest func(conn *idl.Connection) error) error
- func GetCatalogVersion(intermediate *greenplum.Cluster) (string, error)
- func GetCheckpointSegmentsAndEncoding(gpinitsystemConfig []string, version semver.Version, db *sql.DB) ([]string, error)
- func GetLogArchiveDir(logDir string, upgradeID string, t time.Time) string
- func InitTargetCluster(stream step.OutStreams, intermediate *greenplum.Cluster) error
- func Recoverseg(stream step.OutStreams, cluster *greenplum.Cluster, useHbaHostnames bool) error
- func RenameDataDirectories(agentConns []*idl.Connection, source *greenplum.Cluster, ...) error
- func RenameMirrorTablespacesOnSegments(agentConns []*idl.Connection, source *greenplum.Cluster, ...) error
- func RenameSegmentDataDirs(agentConns []*idl.Connection, renames RenameMap) error
- func ResetLdLibraryPathCommand()
- func ResetPathCommand()
- func ResetgRPCDialer()
- func RestartAgents(ctx context.Context, dialer func(context.Context, string) (net.Conn, error), ...) ([]string, error)
- func RestoreCoordinatorAndPrimariesPgControl(streams step.OutStreams, agentConns []*idl.Connection, ...) error
- func RsyncCoordinator(stream step.OutStreams, standby greenplum.SegConfig, ...) error
- func RsyncCoordinatorAndPrimaries(stream step.OutStreams, agentConns []*idl.Connection, ...) error
- func RsyncCoordinatorAndPrimariesTablespaces(stream step.OutStreams, agentConns []*idl.Connection, ...) error
- func RsyncCoordinatorDataDir(stream step.OutStreams, sourceDir, targetDir string) error
- func RsyncCoordinatorTablespaces(stream step.OutStreams, standbyHostname string, ...) error
- func RsyncMirrorDataDirsOnSegments(agentConns []*idl.Connection, source *greenplum.Cluster, ...) error
- func RsyncMirrorTablespacesOnSegments(agentConns []*idl.Connection, source *greenplum.Cluster, ...) error
- func RsyncPrimaries(agentConns []*idl.Connection, source *greenplum.Cluster) error
- func RsyncPrimariesTablespaces(agentConns []*idl.Connection, source *greenplum.Cluster, ...) error
- func SetLdLibraryPathCommand(command exectest.Command)
- func SetPathCommand(command exectest.Command)
- func SetgRPCDialer(...)
- func UpdateCatalog(intermediate *greenplum.Cluster, target *greenplum.Cluster) error
- func UpdateConfFiles(agentConns []*idl.Connection, _ step.OutStreams, version semver.Version, ...) error
- func UpdateConfigurationFile(opts []*idl.UpdateFileConfOptions) error
- func UpdateGpSegmentConfiguration(db *sql.DB, target *greenplum.Cluster) (err error)
- func UpdateInternalAutoConfOnMirrors(agentConns []*idl.Connection, intermediate *greenplum.Cluster) error
- func UpdatePostgresqlConfOnSegments(agentConns []*idl.Connection, intermediate *greenplum.Cluster, ...) error
- func UpdateRecoveryConfOnSegments(agentConns []*idl.Connection, version semver.Version, ...) error
- func UpgradeCoordinator(streams step.OutStreams, backupDir string, pgUpgradeVerbose bool, ...) error
- func UpgradeMirrorsUsingGpAddMirrors(streams step.OutStreams, intermediate *greenplum.Cluster, useHbaHostnames bool) (err error)
- func UpgradeMirrorsUsingRsync(agentConns []*idl.Connection, source *greenplum.Cluster, ...) error
- func UpgradePrimaries(agentConns []*idl.Connection, ...) error
- func UpgradeStandby(streams step.OutStreams, intermediate *greenplum.Cluster, useHbaHostnames bool) error
- func WriteInitsystemFile(gpinitsystemConfig []string, gpinitsystemFilepath string) error
- func WriteSegmentArray(config []string, intermediate *greenplum.Cluster) ([]string, error)
- type AgentsGrpcStatus
- type AgentsNotReadyError
- type RenameMap
- type Result
- type Server
- func (s *Server) AgentConns() ([]*idl.Connection, error)
- func (s *Server) Execute(req *idl.ExecuteRequest, stream idl.CliToHub_ExecuteServer) (err error)
- func (s *Server) Finalize(req *idl.FinalizeRequest, stream idl.CliToHub_FinalizeServer) (err error)
- func (s *Server) GenerateInitsystemConfig(source *greenplum.Cluster) error
- func (s *Server) GetConfig(ctx context.Context, req *idl.GetConfigRequest) (*idl.GetConfigReply, error)
- func (s *Server) Initialize(req *idl.InitializeRequest, stream idl.CliToHub_InitializeServer) (err error)
- func (s *Server) InitializeCreateCluster(req *idl.InitializeCreateClusterRequest, ...) (err error)
- func (s *Server) RemoveIntermediateCluster(streams step.OutStreams) error
- func (s *Server) RestartAgents(ctx context.Context, in *idl.RestartAgentsRequest) (*idl.RestartAgentsReply, error)
- func (s *Server) Revert(_ *idl.RevertRequest, stream idl.CliToHub_RevertServer) (err error)
- func (s *Server) Start(port int, daemonize bool) error
- func (s *Server) Stop(closeAgentConns bool)
- func (s *Server) StopAgents() error
- func (s *Server) StopServices(ctx context.Context, in *idl.StopServicesRequest) (*idl.StopServicesReply, error)
Constants ¶
const TimeStringFormat = "20060102T150405"
format of yyyyMMddTHHmmss
Variables ¶
var DialTimeout = 3 * time.Second
var ErrAgentsNotReady = errors.New("gRPC agents not ready")
var ErrHubStopped = errors.New("hub is stopped")
Returned from Server.Start() if Server.Stop() has already been called.
var ErrUnknownCatalogVersion = errors.New("pg_controldata output is missing catalog version")
var ExecCommand = exec.Command
Allow exec.Command to be mocked out by exectest.NewCommand.
var RenameDirectories = upgrade.RenameDirectories
Functions ¶
func AgentHosts ¶
func ArchiveLogDirectories ¶
func ArchiveSegmentLogDirectories ¶
func ArchiveSegmentLogDirectories(agentConns []*idl.Connection, excludeHostname, logArchiveDir string) error
func CheckDiskSpace ¶
func CheckDiskSpace(streams step.OutStreams, agentConns []*idl.Connection, diskFreeRatio float64, source *greenplum.Cluster, sourceTablespaces greenplum.Tablespaces) error
func CheckEnvironment ¶
func CheckEnvironmentOnSegment ¶
CheckEnvironmentOnSegment ensures that multiple versions of Greenplum environments are not mixed. Use ssh instead of gRPC since our utilities like gpinitsystem, gpstart, gpstop, etc. use ssh internally. This checks up front for the following error as described here: https://web.archive.org/web/20220506055918/https://groups.google.com/a/greenplum.org/g/gpdb-dev/c/JN-YwjCCReY/m/0L9wBOvlAQAJ
func Copy ¶
func Copy(streams step.OutStreams, sourceDirs []string, agentHostsToBackupDir backupdir.AgentHostsToBackupDir) error
func CopyCoordinatorDataDir ¶
func CopyCoordinatorDataDir(streams step.OutStreams, coordinatorDataDir string, agentHostsToBackupDir backupdir.AgentHostsToBackupDir) error
func CopyCoordinatorTablespaces ¶
func CopyCoordinatorTablespaces(streams step.OutStreams, sourceVersion semver.Version, tablespaces greenplum.Tablespaces, agentHostsToBackupDir backupdir.AgentHostsToBackupDir) error
func CreateBackupDirectories ¶
func CreateBackupDirectories(streams step.OutStreams, agentConns []*idl.Connection, backupDirs backupdir.BackupDirs) error
func CreateBackupDirectory ¶
func CreateRecoveryConfOnSegments ¶
func CreateRecoveryConfOnSegments(agentConns []*idl.Connection, intermediate *greenplum.Cluster) error
func CreateReplicationSlots ¶
func DeleteBackupDirectories ¶
func DeleteBackupDirectories(streams step.OutStreams, agentConns []*idl.Connection, backupDirs backupdir.BackupDirs) error
func DeleteCoordinatorAndPrimaryDataDirectories ¶
func DeleteCoordinatorAndPrimaryDataDirectories(streams step.OutStreams, agentConns []*idl.Connection, intermediate *greenplum.Cluster) error
func DeleteStateDirectories ¶
func DeleteStateDirectories(agentConns []*idl.Connection, excludeHostname string) error
func DeleteTargetTablespaces ¶
func DeleteTargetTablespaces(streams step.OutStreams, agentConns []*idl.Connection, target *greenplum.Cluster, intermediateCatalogVersion string, sourceTablespaces greenplum.Tablespaces) error
func DeleteTargetTablespacesOnCoordinator ¶
func DeleteTargetTablespacesOnCoordinator(streams step.OutStreams, target *greenplum.Cluster, coordinatorTablespaces greenplum.SegmentTablespaces, catalogVersion string) error
func DeleteTargetTablespacesOnPrimaries ¶
func DeleteTargetTablespacesOnPrimaries(agentConns []*idl.Connection, target *greenplum.Cluster, tablespaces greenplum.Tablespaces, catalogVersion string) error
func EnsureConnsAreReady ¶
func EnsureConnsAreReady(agentConns []*idl.Connection, timeout time.Duration) error
func ExecuteRPC ¶
func ExecuteRPC(agentConns []*idl.Connection, executeRequest func(conn *idl.Connection) error) error
func GetLogArchiveDir ¶
GetLogArchiveDir returns the name of the file to be used to store logs from this run of gpupgrade during a revert.
func InitTargetCluster ¶
func InitTargetCluster(stream step.OutStreams, intermediate *greenplum.Cluster) error
func Recoverseg ¶
func RenameDataDirectories ¶
func RenameSegmentDataDirs ¶
func RenameSegmentDataDirs(agentConns []*idl.Connection, renames RenameMap) error
e.g. for source /data/dbfast1/demoDataDir0 becomes /data/dbfast1/demoDataDir0_old e.g. for target /data/dbfast1/demoDataDir0_123ABC becomes /data/dbfast1/demoDataDir0
func ResetLdLibraryPathCommand ¶
func ResetLdLibraryPathCommand()
func ResetgRPCDialer ¶
func ResetgRPCDialer()
func RestartAgents ¶
func RestoreCoordinatorAndPrimariesPgControl ¶
func RestoreCoordinatorAndPrimariesPgControl(streams step.OutStreams, agentConns []*idl.Connection, source *greenplum.Cluster) error
func RsyncCoordinator ¶
func RsyncCoordinatorAndPrimaries ¶
func RsyncCoordinatorAndPrimaries(stream step.OutStreams, agentConns []*idl.Connection, source *greenplum.Cluster) error
func RsyncCoordinatorAndPrimariesTablespaces ¶
func RsyncCoordinatorAndPrimariesTablespaces(stream step.OutStreams, agentConns []*idl.Connection, source *greenplum.Cluster) error
func RsyncCoordinatorDataDir ¶
func RsyncCoordinatorDataDir(stream step.OutStreams, sourceDir, targetDir string) error
func RsyncCoordinatorTablespaces ¶
func RsyncCoordinatorTablespaces(stream step.OutStreams, standbyHostname string, coordinatorTablespaces greenplum.SegmentTablespaces, standbyTablespaces greenplum.SegmentTablespaces) error
func RsyncPrimaries ¶
func RsyncPrimaries(agentConns []*idl.Connection, source *greenplum.Cluster) error
func RsyncPrimariesTablespaces ¶
func RsyncPrimariesTablespaces(agentConns []*idl.Connection, source *greenplum.Cluster, tablespaces greenplum.Tablespaces) error
func SetLdLibraryPathCommand ¶
func SetgRPCDialer ¶
func SetgRPCDialer(dialer func(ctx context.Context, target string, opts ...grpc.DialOption) (*grpc.ClientConn, error))
func UpdateCatalog ¶
func UpdateConfFiles ¶
func UpdateConfFiles(agentConns []*idl.Connection, _ step.OutStreams, version semver.Version, intermediate *greenplum.Cluster, target *greenplum.Cluster) error
func UpdateConfigurationFile ¶
func UpdateConfigurationFile(opts []*idl.UpdateFileConfOptions) error
func UpdateInternalAutoConfOnMirrors ¶
func UpdateInternalAutoConfOnMirrors(agentConns []*idl.Connection, intermediate *greenplum.Cluster) error
func UpgradeCoordinator ¶
func UpgradePrimaries ¶
func UpgradePrimaries(agentConns []*idl.Connection, agentHostToBackupDir backupdir.AgentHostsToBackupDir, pgUpgradeVerbose bool, skipPgUpgradeChecks bool, pgUpgradeJobs uint, source *greenplum.Cluster, intermediate *greenplum.Cluster, action idl.PgOptions_Action, mode idl.Mode, pgUpgradeTimestamp string) error
func UpgradeStandby ¶
func UpgradeStandby(streams step.OutStreams, intermediate *greenplum.Cluster, useHbaHostnames bool) error
UpgradeStandby removes any possible existing standby from the cluster before adding a new one for idempotency. In the happy-path, we expect this to fail as there should not be an existing standby for the cluster.
func WriteInitsystemFile ¶
Types ¶
type AgentsGrpcStatus ¶
type AgentsGrpcStatus map[string]connectivity.State
func (AgentsGrpcStatus) String ¶
func (a AgentsGrpcStatus) String() string
type AgentsNotReadyError ¶
type AgentsNotReadyError struct {
Agents AgentsGrpcStatus
}
func (*AgentsNotReadyError) Error ¶
func (a *AgentsNotReadyError) Error() string
func (*AgentsNotReadyError) Is ¶
func (a *AgentsNotReadyError) Is(err error) bool
type RenameMap ¶
type RenameMap = map[string][]*idl.RenameDirectories
type Server ¶
func (*Server) AgentConns ¶
func (s *Server) AgentConns() ([]*idl.Connection, error)
func (*Server) Execute ¶
func (s *Server) Execute(req *idl.ExecuteRequest, stream idl.CliToHub_ExecuteServer) (err error)
func (*Server) Finalize ¶
func (s *Server) Finalize(req *idl.FinalizeRequest, stream idl.CliToHub_FinalizeServer) (err error)
func (*Server) GenerateInitsystemConfig ¶
func (*Server) GetConfig ¶
func (s *Server) GetConfig(ctx context.Context, req *idl.GetConfigRequest) (*idl.GetConfigReply, error)
func (*Server) Initialize ¶
func (s *Server) Initialize(req *idl.InitializeRequest, stream idl.CliToHub_InitializeServer) (err error)
func (*Server) InitializeCreateCluster ¶
func (s *Server) InitializeCreateCluster(req *idl.InitializeCreateClusterRequest, stream idl.CliToHub_InitializeCreateClusterServer) (err error)
func (*Server) RemoveIntermediateCluster ¶
func (s *Server) RemoveIntermediateCluster(streams step.OutStreams) error
func (*Server) RestartAgents ¶
func (s *Server) RestartAgents(ctx context.Context, in *idl.RestartAgentsRequest) (*idl.RestartAgentsReply, error)
func (*Server) Revert ¶
func (s *Server) Revert(_ *idl.RevertRequest, stream idl.CliToHub_RevertServer) (err error)
func (*Server) StopAgents ¶
TODO: Add unit tests which is currently tricky due to h.AgentConns() mutating global state
func (*Server) StopServices ¶
func (s *Server) StopServices(ctx context.Context, in *idl.StopServicesRequest) (*idl.StopServicesReply, error)
Source Files ¶
- add_mirrors_to_catalog.go
- add_replication_entries.go
- append_dynamic_library_path.go
- archive_log_directory.go
- check_disk_space.go
- check_environment.go
- common.go
- config.go
- copy_coordinator.go
- create_backup_directory.go
- create_recovery_conf.go
- create_replication_slot.go
- delete_backup_directories.go
- delete_data_directories.go
- delete_state_directories.go
- execute.go
- finalize.go
- init_target_cluster.go
- initialize.go
- rename_data_directories.go
- restore_source_cluster.go
- revert.go
- rpc.go
- server.go
- update_catalog.go
- update_conf_files.go
- upgrade_coordinator.go
- upgrade_mirrors_using_gpaddmirrors.go
- upgrade_mirrors_using_rsync.go
- upgrade_primaries.go
- upgrade_standby.go