Commit fc9a51ca authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 24c420c0
......@@ -463,6 +463,19 @@ loop:
case ech := <-m.ctlStop:
close(ech) // ok; we are already recovering
// peer (should be) disconnected
case n := <-m.nodeLeaveq:
// XXX -> move to func
peer := n.peer
peer.node.Link().Close() // XXX err
peer.node.ResetLink()
delete(m.peerTab, peer.node.NID)
m.updateNodeState(ctx, peer.node, proto.DOWN)
updateReadyToStart()
// new connection comes in and asks to be identified
case n := <-m.nodeComeq:
peer, ok := m.identify(ctx, n,
......@@ -498,44 +511,19 @@ loop:
return err
})
// XXX move up (before nodeComeq) ?
case n := <-m.nodeLeaveq:
// XXX -> move to func
peer := n.peer
peer.node.Link().Close() // XXX err
peer.node.ResetLink()
delete(m.peerTab, peer.node.NID)
m.updateNodeState(ctx, peer.node, proto.DOWN)
updateReadyToStart() // XXX here yes?
// a storage node came through recovery - let's see whether
// ptid ↑ and if so we should take partition table from there
//
// FIXME after a storage recovers, it could go away while
// recovery for others is in progress -> monitor this.
case r := <-recoveryq:
close(r.ack) // for <-"node leave" to happen after <-recovery in case of err
inprogress--
if r.err != nil {
log.Error(ctx, r.err)
/*
if !xcontext.Canceled(r.err) {
r.stor.ResetLink(ctx)
m.updateNodeState(ctx, r.stor, proto.DOWN)
// XXX stop sending nodeTab/partTab updates to this node
}
*/
} else {
// we are interested in latest partTab
// NOTE during recovery no one must be subscribed to
// partTab so it is ok to simply change whole m.partTab
// TODO -> updatePartTab()
if r.partTab.PTid > m.node.State.PartTab.PTid {
m.node.State.PartTab = r.partTab
}
......
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