MCPcopy
hub / github.com/google/seesaw / HAUpdate

Method HAUpdate

engine/ipc.go:112–133  ·  view source on GitHub ↗

HAUpdate advises the Engine of the current high-availability status for the Seesaw HA component. The Seesaw Engine may also request a failover in response.

(args *ipc.HAStatus, failover *bool)

Source from the content-addressed store, hash-verified

110// the Seesaw HA component. The Seesaw Engine may also request a failover
111// in response.
112func (s *SeesawEngine) HAUpdate(args *ipc.HAStatus, failover *bool) error {
113 if args == nil {
114 return errors.New("args is nil")
115 }
116 ctx := args.Ctx
117 s.trace("HAUpdate", ctx)
118 if ctx == nil {
119 return errContext
120 }
121
122 if !ctx.IsTrusted() {
123 return errAccess
124 }
125
126 if err := s.engine.setHAStatus(args.Status); err != nil {
127 return err
128 }
129 if failover != nil {
130 *failover = s.engine.haManager.failover()
131 }
132 return nil
133}
134
135// HAState advises the Engine of the current high-availability state as
136// determined by the Seesaw HA component.

Callers

nothing calls this directly

Calls 4

traceMethod · 0.95
IsTrustedMethod · 0.80
setHAStatusMethod · 0.80
failoverMethod · 0.45

Tested by

no test coverage detected