Commit 37dce98f authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 879624ea
......@@ -39,15 +39,25 @@ import (
"lab.nexedi.com/kirr/neo/go/neo/xneo"
)
// _MasteredNode provides base functioanlity of a NEO node driven by master.
// _MasteredNode provides base functionality of a NEO node driven by master.
//
// XXX requests/notifications from master go through filter that handles
// nodeTab/partTab/ClusterState changes ...
// It connects to master, identifies to it, and handles master messages about
// δNodeTab, δPartTab and δClusterState to update local replica of cluster
// state. The other messages from master are passed through to RecvM1. In other
// words _MasteredNode installs a kind of reception pipeline in between master
// and _MasteredNode user:
//
// talkMaster persists connection to master node, and receives update from M
// about δNodeTab, δPartTab, ClusterState.
//
// XXX how to use
// δNodeTab
// δPartTab
// δClusterState
// ↑
// RecvM1 ---------------
// user <-------- | _MasteredNode | <- M
// ---------------
//
// This pipeline is operated by TalkMaster.
// The connection to master is persisted by redial as needed.
type _MasteredNode struct {
myInfo proto.NodeInfo // type, laddr, nid, state, idtime
ClusterName string
......@@ -58,7 +68,7 @@ type _MasteredNode struct {
stateMu sync.RWMutex
state xneo.ClusterState
// operational state in node is maintained by talkMaster.
// operational state in node is maintained by TalkMaster.
// users retrieve it via withOperational(). XXX recheck
//
// NOTE being operational means:
......@@ -73,19 +83,7 @@ type _MasteredNode struct {
flags _MasteredNodeFlags
rxm chan _RxM // talkMaster -> RecvM1
/*
// TODO -> RecvM1 instead
// OnNotify, if !nil, is called when master notifies this node with a message.
// XXX not called for δstate
OnNotify func(msg proto.Msg) error // XXX kill
// OnNotifyδPartTab, if !nil, is called when master notifies this node
// with a change to partition table. (used by S to persist partTab)
OnNotifyδPartTab func(pt *xneo.PartitionTable) error // XXX kill
*/
rxm chan _RxM // TalkMaster -> RecvM1
}
// _RxM represents a request or event received from master.
......@@ -286,8 +284,6 @@ func (node *_MasteredNode) recvMaster1(ctx context.Context, req neonet.Request)
return nil
}
var eventMasterReconnect = errors.New("(re)connected to master")
// RecvM1 receives request from master filtered through δstate handler.
//
// XXX link down ?
......
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