Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
4a9252a6
Commit
4a9252a6
authored
Feb 12, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e21fe877
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
go/neo/master.go
go/neo/master.go
+11
-10
No files found.
go/neo/master.go
View file @
4a9252a6
...
...
@@ -486,16 +486,9 @@ loop:
// peer (should be) disconnected
case
n
:=
<-
m
.
nodeLeaveq
:
// XXX -> move to func
peer
:=
n
.
peer
peer
.
node
.
ResetLink
(
ctx
)
delete
(
m
.
peerTab
,
peer
.
node
.
NID
)
m
.
updateNodeState
(
ctx
,
peer
.
node
,
proto
.
DOWN
)
m
.
disconnectPeer
(
ctx
,
n
.
peer
)
updateReadyToStart
()
// node comes in and asks to be identified
case
n
:=
<-
m
.
nodeComeq
:
peer
,
ok
:=
m
.
identify
(
ctx
,
n
,
...
...
@@ -706,8 +699,7 @@ loop:
// peer (should be) disconnected
case
n
:=
<-
m
.
nodeLeaveq
:
// XXX update
n
.
node
.
SetState
(
proto
.
DOWN
)
m
.
disconnectPeer
(
ctx
,
n
.
peer
)
// if cluster became non-operational - we cancel verification
if
!
m
.
node
.
State
.
PartTab
.
OperationalWith
(
m
.
node
.
State
.
NodeTab
)
{
...
...
@@ -1052,6 +1044,14 @@ func (m *Master) serveClient1(ctx context.Context, req proto.Msg) (resp proto.Ms
// ----------------------------------------
// disconnectPeer resets link to the peer and sets its state to DOWN in nodeTab.
// other peers are notified with δnodeTab about it.
func
(
m
*
Master
)
disconnectPeer
(
ctx
context
.
Context
,
peer
*
_MasteredPeer
)
{
peer
.
node
.
ResetLink
(
ctx
)
delete
(
m
.
peerTab
,
peer
.
node
.
NID
)
m
.
updateNodeState
(
ctx
,
peer
.
node
,
proto
.
DOWN
)
}
// updateNodeTab = .nodeTab.Update + send δnodeTab to all subscribers.
// XXX place
// called from main master process. XXX
...
...
@@ -1069,6 +1069,7 @@ func (m *Master) updateNodeTab(ctx context.Context, nodeInfo proto.NodeInfo) *xn
default
:
}
// XXX try to move logging into other place - so that we could remove ctx arg here
log
.
Warningf
(
ctx
,
"peer %s is slow -> detaching it"
,
nid
)
close
(
peer
.
notifyqOverflow
)
// TODO delete(m.peerTab, nid) -> p.cancel()
...
...
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