Commit a8818cc3 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f2a1eb68
......@@ -23,11 +23,9 @@ package xneo
//go:generate gotrace gen .
import (
// "context"
"sync"
"lab.nexedi.com/kirr/go123/xnet"
// "lab.nexedi.com/kirr/neo/go/internal/log"
"lab.nexedi.com/kirr/neo/go/neo/proto"
)
......@@ -82,53 +80,3 @@ func NewNode(net xnet.Networker, typ proto.NodeType, clusterName, masterAddr str
node.NodeTab.localNode = node
return node
}
/*
// ----------------------------------------
// XXX kill -> only in MasteredNode / talkMaster
// UpdateNodeTab applies updates to .NodeTab from message and logs changes appropriately.
func (node *Node) UpdateNodeTab(ctx context.Context, msg *proto.NotifyNodeInformation) {
// XXX msg.IdTime ?
for _, nodeInfo := range msg.NodeList {
log.Infof(ctx, "node update: %v", nodeInfo)
node.NodeTab.Update(nodeInfo)
// XXX we have to provide IdTime when requesting identification to other peers
// (e.g. Spy checks this is what master broadcast them and if not replies "unknown by master")
if nodeInfo.NID == node.MyInfo.NID {
// XXX recheck locking
// XXX do .MyInfo = nodeInfo ?
node.MyInfo.IdTime = nodeInfo.IdTime
// FIXME hack - better it be separate command and handled cleanly
if nodeInfo.State == proto.DOWN {
log.Info(ctx, "master told us to shutdown")
log.Flush()
node.OnShutdown()
// os.Exit(1)
return
}
}
}
// FIXME logging under lock (if caller took e.g. .StateMu before applying updates)
log.Infof(ctx, "full nodetab:\n%s", node.NodeTab)
}
// UpdatePartTab applies updates to .PartTab from message and logs changes appropriately.
func (node *Node) UpdatePartTab(ctx context.Context, msg *proto.SendPartitionTable) {
pt := PartTabFromDump(msg.PTid, msg.RowList) // FIXME handle msg.NumReplicas
// XXX logging under lock
log.Infof(ctx, "parttab update: %v", pt)
node.PartTab = pt
}
// UpdateClusterState applies update to .ClusterState from message and logs change appropriately.
func (node *Node) UpdateClusterState(ctx context.Context, msg *proto.NotifyClusterState) {
// XXX loging under lock
log.Infof(ctx, "state update: %v", msg.State)
node.ClusterState.Set(msg.State)
}
*/
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