redundancy

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CheckActiveLogInterval = time.Second * 10
View Source
const HighAvailabilityManagerDisabled = "HighAvailabilityManagerDisabled"
View Source
const MaxRedisUnreachableRetries = 3
View Source
const RedisPingFail string = "Redis Ping Fail"

Variables

This section is empty.

Functions

This section is empty.

Types

type HAWatcher

type HAWatcher interface {
	ActiveChangedPreSwitch(ctx context.Context, haRole string, platformActive bool) error  // actions before setting PlatformInstanceActive
	ActiveChangedPostSwitch(ctx context.Context, haRole string, platformActive bool) error // actions after setting PlatformInstanceActive
	PlatformActiveOnStartup(ctx context.Context)                                           // actions if the platform is active on first
	DumpWatcherFields(ctx context.Context) map[string]interface{}
}

type HighAvailabilityManager

type HighAvailabilityManager struct {
	HARole    string
	HAEnabled bool

	PlatformInstanceActive     bool
	ActiveTransitionInProgress bool // active from a redis standpoint but still doing switchover actions
	RedisConnectionFailed      bool // used when primary becomes active due to redis unavailability
	// contains filtered or unexported fields
}

func (*HighAvailabilityManager) BumpActiveExpire

func (s *HighAvailabilityManager) BumpActiveExpire(ctx context.Context) error

func (*HighAvailabilityManager) CheckActive

func (s *HighAvailabilityManager) CheckActive(ctx context.Context) (bool, error)

func (*HighAvailabilityManager) CheckActiveLoop

func (s *HighAvailabilityManager) CheckActiveLoop(ctx context.Context)

func (*HighAvailabilityManager) DumpHAManager

func (*HighAvailabilityManager) GetValue

func (s *HighAvailabilityManager) GetValue(ctx context.Context, key string) (string, error)

func (*HighAvailabilityManager) Init

func (s *HighAvailabilityManager) Init(ctx context.Context, nodeGroupKey string, nodeMgr *node.NodeMgr, activeDuration, activePollInterval edgeproto.Duration, haWatcher HAWatcher) error

func (*HighAvailabilityManager) InitFlags

func (s *HighAvailabilityManager) InitFlags()

func (*HighAvailabilityManager) IsActive

func (s *HighAvailabilityManager) IsActive() bool

func (*HighAvailabilityManager) SetValue

func (s *HighAvailabilityManager) SetValue(ctx context.Context, key string, value string, expiration time.Duration) error

Jump to

Keyboard shortcuts

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