Commit e7446b47 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d3ea97c7
......@@ -85,7 +85,7 @@ const (
δPartTabPassThrough _MasteredNodeFlags = iota
)
// XXX doc
// newMasteredNode creats new _MasteredNode that connects to masterAddr/cluster via net.
func newMasteredNode(typ proto.NodeType, clusterName string, net xnet.Networker, masterAddr string) *_MasteredNode {
node := &_MasteredNode{
Node: xneo.NewNode(typ, clusterName, net, masterAddr),
......@@ -106,8 +106,6 @@ func newMasteredNode(typ proto.NodeType, clusterName string, net xnet.Networker,
// f is called on every reconnection to master after identification and protocol prologue.
//
// See top-level _MasteredNode overview for details.
//
// XXX -> FollowMaster? AdhereMaster?
func (node *_MasteredNode) TalkMaster(ctx context.Context, f func(context.Context, *_MasterLink) error) (err error) {
// start logging with initial NID (that might be temporary, and which master can tell us to change)
ctx0 := ctx
......@@ -158,7 +156,7 @@ func (node *_MasteredNode) talkMaster1(ctx, ctxPreTalkM context.Context, f func(
node.MyInfo.NID = accept.YourNID // XXX locking ? -> opMu ?
}
// XXX verify Mnid = M*; our nid corresponds to our type
// TODO verify Mnid = M*; our nid corresponds to our type
// rebuild nicer task now - when we know both our and master NIDs
// e.g. "C?: talk master(127.0.0.1:21484)" -> "C1: talk M1".
......@@ -177,7 +175,7 @@ func (node *_MasteredNode) talkMaster1(ctx, ctxPreTalkM context.Context, f func(
// partTab (not to S and secondary M(?))
// https://lab.nexedi.com/nexedi/neoppod/blob/v1.12-69-gd98205d0/neo/master/handlers/__init__.py#L60-67
pt := node.State.PartTab
if !(node.MyInfo.Type == proto.STORAGE) { // XXX -> use flag instead?
if !(node.MyInfo.Type == proto.STORAGE) {
mpt := proto.SendPartitionTable{}
_, err = mlink.Expect1(&mpt)
if err != nil {
......@@ -220,7 +218,7 @@ type _MasterLink struct {
// Must be called only when master link is established - e.g. from under TalkMaster.
func (mlink *_MasterLink) Recv1(ctx context.Context) (neonet.Request, error) {
for {
req, err := mlink.NodeLink.Recv1() // cancel on ctx
req, err := mlink.NodeLink.Recv1() // XXX cancel on ctx
if err != nil {
return neonet.Request{}, err
}
......@@ -391,7 +389,6 @@ func (node *_MasteredNode) updateNodeTab(ctx context.Context, msg *proto.NotifyN
}
}
// XXX logging under lock ok?
log.Infof(ctx, "full nodetab:\n%s", node.State.NodeTab)
return nil
}
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