failovermanager

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// TaskListName tasklist
	TaskListName = "cadence-sys-failoverManager-tasklist"
	// WorkflowTypeName workflow type name
	WorkflowTypeName = "cadence-sys-failoverManager-workflow"
	// WorkflowID will be reused to ensure only one workflow running
	WorkflowID = "cadence-failover-manager"

	// QueryType for failover workflow
	QueryType = "state"
	// PauseSignal signal name for pause
	PauseSignal = "pause"
	// ResumeSignal signal name for resume
	ResumeSignal = "resume"

	// WorkflowRunning state
	WorkflowRunning = "running"
	// WorkflowPaused state
	WorkflowPaused = "paused"
	// WorkflowCompleted state
	WorkflowCompleted = "complete"
	// WorkflowAborted state
	WorkflowAborted = "aborted"
)

Variables

This section is empty.

Functions

func GetDomainsActivity

func GetDomainsActivity(ctx context.Context, params *GetDomainsActivityParams) ([]string, error)

GetDomainsActivity activity def

Types

type BootstrapParams

type BootstrapParams struct {
	// Config contains the configuration for scanner
	Config Config
	// ServiceClient is an instance of cadence service client
	ServiceClient workflowserviceclient.Interface
	// MetricsClient is an instance of metrics object for emitting stats
	MetricsClient metrics.Client
	Logger        log.Logger
	// TallyScope is an instance of tally metrics scope
	TallyScope tally.Scope
	// ClientBean is an instance of client.Bean for a collection of clients
	ClientBean client.Bean
}

BootstrapParams contains the set of params needed to bootstrap failover manager

type Config

type Config struct {
	AdminOperationToken dynamicconfig.StringPropertyFn
	// ClusterMetadata contains the metadata for this cluster
	ClusterMetadata cluster.Metadata
}

Config defines the configuration for failover

type FailoverActivityParams

type FailoverActivityParams struct {
	Domains       []string
	TargetCluster string
}

FailoverActivityParams params for activity

type FailoverActivityResult

type FailoverActivityResult struct {
	SuccessDomains []string
	FailedDomains  []string
}

FailoverActivityResult result for failover activity

func FailoverActivity

func FailoverActivity(ctx context.Context, params *FailoverActivityParams) (*FailoverActivityResult, error)

FailoverActivity activity def

type FailoverManager

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

FailoverManager of cadence worker service

func New

func New(params *BootstrapParams) *FailoverManager

New returns a new instance of FailoverManager

func (*FailoverManager) Start

func (s *FailoverManager) Start() error

Start starts the worker

func (*FailoverManager) Stop

func (s *FailoverManager) Stop()

Stop stops the worker

type FailoverParams

type FailoverParams struct {
	// TargetCluster is the destination of failover
	TargetCluster string
	// SourceCluster is from which cluster the domains are active before failover
	SourceCluster string
	// BatchFailoverSize is number of domains to failover in one batch
	BatchFailoverSize int
	// BatchFailoverWaitTimeInSeconds is the waiting time between batch failover
	BatchFailoverWaitTimeInSeconds int
	// Domains candidates to be failover
	Domains []string
}

FailoverParams is the arg for failoverWorkflow

type FailoverResult

type FailoverResult struct {
	SuccessDomains []string
	FailedDomains  []string
}

FailoverResult is workflow result

func FailoverWorkflow

func FailoverWorkflow(ctx workflow.Context, params *FailoverParams) (*FailoverResult, error)

FailoverWorkflow is the workflow that managed failover all domains with IsManagedByCadence=true

type GetDomainsActivityParams

type GetDomainsActivityParams struct {
	TargetCluster string
	SourceCluster string
	Domains       []string
}

GetDomainsActivityParams params for activity

type QueryResult

type QueryResult struct {
	TotalDomains   int
	Success        int
	Failed         int
	State          string
	TargetCluster  string
	SourceCluster  string
	SuccessDomains []string // SuccessDomains are guaranteed succeed processed
	FailedDomains  []string // FailedDomains contains false positive
	Operator       string
}

QueryResult for failover progress

Jump to

Keyboard shortcuts

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