Commit 9b955162 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent df1df655
......@@ -276,7 +276,7 @@ func (node *_MasteredNode) recvδstate(ctx context.Context, msg proto.Msg) (δpt
δpt = false
// update .operational + notify those who was waiting for it
node.updateOperational(func() {
node.modifyState(func(s *xneo.State) {
switch msg := msg.(type) {
default:
panic(fmt.Sprintf("unexpected message: %T", msg))
......@@ -286,7 +286,7 @@ func (node *_MasteredNode) recvδstate(ctx context.Context, msg proto.Msg) (δpt
δpt = true
pt := xneo.PartTabFromMsg(msg)
log.Infof(ctx, "<- parttab: %s", pt)
node.State.PartTab = pt
s.PartTab = pt
// <- δ(partTab)
case *proto.NotifyPartitionChanges:
......@@ -295,12 +295,12 @@ func (node *_MasteredNode) recvδstate(ctx context.Context, msg proto.Msg) (δpt
// <- δ(nodeTab)
case *proto.NotifyNodeInformation:
err = node.updateNodeTab(ctx, msg) // err might be command to shutdown
err = s.updateNodeTab(ctx, msg) // err might be command to shutdown
case *proto.NotifyClusterState:
log.Infof(ctx, "<- state: %s", msg.State)
node.State.Code.Set(msg.State)
traceClusterStateChanged(&node.State.Code)
s.ClusterState.Set(msg.State)
traceClusterStateChanged(&s.ClusterState)
}
})
......@@ -311,13 +311,13 @@ func (node *_MasteredNode) recvδstate(ctx context.Context, msg proto.Msg) (δpt
// updateOperational calls δf under .opMu and updates .operational from current state.
// After .opMu unlock it also notifies those who was waiting for .operational to become y.
func (node *_MasteredNode) modifyState(δf func(s */*_Mastered*/State)) {
func (node *_MasteredNode) modifyState(δf func(s */*_Mastered*/xneo.State)) {
var opready chan struct{}
node.opMu.Lock()
func() {
defer node.opMu.Unlock()
δf()
δf(nil/*FIXME*/)
operational := (node.mlink != nil) && node.State.IsOperational()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment