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
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:
...
@@ -486,16 +486,9 @@ loop:
// peer (should be) disconnected
// peer (should be) disconnected
case
n
:=
<-
m
.
nodeLeaveq
:
case
n
:=
<-
m
.
nodeLeaveq
:
// XXX -> move to func
m
.
disconnectPeer
(
ctx
,
n
.
peer
)
peer
:=
n
.
peer
peer
.
node
.
ResetLink
(
ctx
)
delete
(
m
.
peerTab
,
peer
.
node
.
NID
)
m
.
updateNodeState
(
ctx
,
peer
.
node
,
proto
.
DOWN
)
updateReadyToStart
()
updateReadyToStart
()
// node comes in and asks to be identified
// node comes in and asks to be identified
case
n
:=
<-
m
.
nodeComeq
:
case
n
:=
<-
m
.
nodeComeq
:
peer
,
ok
:=
m
.
identify
(
ctx
,
n
,
peer
,
ok
:=
m
.
identify
(
ctx
,
n
,
...
@@ -706,8 +699,7 @@ loop:
...
@@ -706,8 +699,7 @@ loop:
// peer (should be) disconnected
// peer (should be) disconnected
case
n
:=
<-
m
.
nodeLeaveq
:
case
n
:=
<-
m
.
nodeLeaveq
:
// XXX update
m
.
disconnectPeer
(
ctx
,
n
.
peer
)
n
.
node
.
SetState
(
proto
.
DOWN
)
// if cluster became non-operational - we cancel verification
// if cluster became non-operational - we cancel verification
if
!
m
.
node
.
State
.
PartTab
.
OperationalWith
(
m
.
node
.
State
.
NodeTab
)
{
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
...
@@ -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.
// updateNodeTab = .nodeTab.Update + send δnodeTab to all subscribers.
// XXX place
// XXX place
// called from main master process. XXX
// called from main master process. XXX
...
@@ -1069,6 +1069,7 @@ func (m *Master) updateNodeTab(ctx context.Context, nodeInfo proto.NodeInfo) *xn
...
@@ -1069,6 +1069,7 @@ func (m *Master) updateNodeTab(ctx context.Context, nodeInfo proto.NodeInfo) *xn
default
:
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
)
log
.
Warningf
(
ctx
,
"peer %s is slow -> detaching it"
,
nid
)
close
(
peer
.
notifyqOverflow
)
close
(
peer
.
notifyqOverflow
)
// TODO delete(m.peerTab, nid) -> p.cancel()
// 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