Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
37dce98f
Commit
37dce98f
authored
Jan 29, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
879624ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
22 deletions
+18
-22
go/neo/mastered.go
go/neo/mastered.go
+18
-22
No files found.
go/neo/mastered.go
View file @
37dce98f
...
...
@@ -39,15 +39,25 @@ import (
"lab.nexedi.com/kirr/neo/go/neo/xneo"
)
// _MasteredNode provides base functio
an
lity of a NEO node driven by master.
// _MasteredNode provides base functio
na
lity 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
t
alkMaster.
// operational state in node is maintained by
T
alkMaster.
// 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 ?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment