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
839d42a6
Commit
839d42a6
authored
Feb 05, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a6935abb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
go/neo/master.go
go/neo/master.go
+4
-9
No files found.
go/neo/master.go
View file @
839d42a6
...
@@ -985,6 +985,7 @@ func (m *Master) serveClient1(ctx context.Context, req proto.Msg) (resp proto.Ms
...
@@ -985,6 +985,7 @@ func (m *Master) serveClient1(ctx context.Context, req proto.Msg) (resp proto.Ms
// ----------------------------------------
// ----------------------------------------
// updateNodeTab = .nodeTab.Update + send δnodeTab to all subscribers.
// XXX place
// XXX place
// called from main master process. XXX
// called from main master process. XXX
func
(
m
*
Master
)
updateNodeTab
(
ctx
context
.
Context
,
nodeInfo
proto
.
NodeInfo
)
*
xneo
.
PeerNode
{
func
(
m
*
Master
)
updateNodeTab
(
ctx
context
.
Context
,
nodeInfo
proto
.
NodeInfo
)
*
xneo
.
PeerNode
{
...
@@ -1003,6 +1004,7 @@ func (m *Master) updateNodeTab(ctx context.Context, nodeInfo proto.NodeInfo) *xn
...
@@ -1003,6 +1004,7 @@ func (m *Master) updateNodeTab(ctx context.Context, nodeInfo proto.NodeInfo) *xn
log
.
Warningf
(
ctx
,
"peer %s is slow -> detaching it"
,
nid
)
log
.
Warningf
(
ctx
,
"peer %s is slow -> detaching it"
,
nid
)
// TODO ^^^
// TODO ^^^
panic
(
"TODO"
)
}
}
return
peer
return
peer
...
@@ -1108,8 +1110,9 @@ func (m *Master) keepPeerUpdated(ctx context.Context, link *neonet.NodeLink) (er
...
@@ -1108,8 +1110,9 @@ func (m *Master) keepPeerUpdated(ctx context.Context, link *neonet.NodeLink) (er
// identify processes identification request of just connected node and either accepts or declines it.
// identify processes identification request of just connected node and either accepts or declines it.
//
//
// If node identification is accepted .nodeTab is updated and corresponding node entry is returned.
// If node identification is accepted .nodeTab is updated and corresponding node entry is returned.
// XXX + state0. XXX +notifyTab.
// Response message is constructed but not send back not to block the caller - it is
// Response message is constructed but not send back not to block the caller - it is
// the caller responsibility to send the response to node which requested identification.
// the caller responsibility to send the response to node which requested identification.
XXX via .accept()
func
(
m
*
Master
)
identify
(
ctx
context
.
Context
,
n
nodeCome
)
(
node
*
xneo
.
PeerNode
,
state0
*
xneo
.
ClusterStateSnapshot
,
resp
proto
.
Msg
)
{
func
(
m
*
Master
)
identify
(
ctx
context
.
Context
,
n
nodeCome
)
(
node
*
xneo
.
PeerNode
,
state0
*
xneo
.
ClusterStateSnapshot
,
resp
proto
.
Msg
)
{
// XXX also verify ? :
// XXX also verify ? :
// - NodeType valid
// - NodeType valid
...
@@ -1189,7 +1192,6 @@ func (m *Master) identify(ctx context.Context, n nodeCome) (node *xneo.PeerNode,
...
@@ -1189,7 +1192,6 @@ func (m *Master) identify(ctx context.Context, n nodeCome) (node *xneo.PeerNode,
IdTime
:
proto
.
IdTime
(
m
.
monotime
()),
IdTime
:
proto
.
IdTime
(
m
.
monotime
()),
}
}
// node = m.node.State.NodeTab.Update(nodeInfo) // NOTE this notifies all nodeTab subscribers
node
=
m
.
updateNodeTab
(
ctx
,
nodeInfo
)
node
=
m
.
updateNodeTab
(
ctx
,
nodeInfo
)
node
.
SetLink
(
n
.
req
.
Link
())
node
.
SetLink
(
n
.
req
.
Link
())
...
@@ -1199,13 +1201,6 @@ func (m *Master) identify(ctx context.Context, n nodeCome) (node *xneo.PeerNode,
...
@@ -1199,13 +1201,6 @@ func (m *Master) identify(ctx context.Context, n nodeCome) (node *xneo.PeerNode,
// (see updateNodeTab for details)
// (see updateNodeTab for details)
notifyq
:=
make
(
chan
_ΔClusterState
,
1024
)
notifyq
:=
make
(
chan
_ΔClusterState
,
1024
)
m
.
notifyTab
[
node
.
NID
]
=
notifyq
m
.
notifyTab
[
node
.
NID
]
=
notifyq
// XXX go not here - only after initial state is sent out
/*
m.notifyWG.Add(1)
go func() {
defer m.notifyWG.Done()
}()
*/
return
node
,
state0
,
accept
return
node
,
state0
,
accept
}
}
...
...
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