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
fc9a51ca
Commit
fc9a51ca
authored
Feb 12, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
24c420c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
26 deletions
+14
-26
go/neo/master.go
go/neo/master.go
+14
-26
No files found.
go/neo/master.go
View file @
fc9a51ca
...
...
@@ -463,6 +463,19 @@ loop:
case
ech
:=
<-
m
.
ctlStop
:
close
(
ech
)
// ok; we are already recovering
// peer (should be) disconnected
case
n
:=
<-
m
.
nodeLeaveq
:
// XXX -> move to func
peer
:=
n
.
peer
peer
.
node
.
Link
()
.
Close
()
// XXX err
peer
.
node
.
ResetLink
()
delete
(
m
.
peerTab
,
peer
.
node
.
NID
)
m
.
updateNodeState
(
ctx
,
peer
.
node
,
proto
.
DOWN
)
updateReadyToStart
()
// new connection comes in and asks to be identified
case
n
:=
<-
m
.
nodeComeq
:
peer
,
ok
:=
m
.
identify
(
ctx
,
n
,
...
...
@@ -498,44 +511,19 @@ loop:
return
err
})
// XXX move up (before nodeComeq) ?
case
n
:=
<-
m
.
nodeLeaveq
:
// XXX -> move to func
peer
:=
n
.
peer
peer
.
node
.
Link
()
.
Close
()
// XXX err
peer
.
node
.
ResetLink
()
delete
(
m
.
peerTab
,
peer
.
node
.
NID
)
m
.
updateNodeState
(
ctx
,
peer
.
node
,
proto
.
DOWN
)
updateReadyToStart
()
// XXX here yes?
// a storage node came through recovery - let's see whether
// ptid ↑ and if so we should take partition table from there
//
// FIXME after a storage recovers, it could go away while
// recovery for others is in progress -> monitor this.
case
r
:=
<-
recoveryq
:
close
(
r
.
ack
)
// for <-"node leave" to happen after <-recovery in case of err
inprogress
--
if
r
.
err
!=
nil
{
log
.
Error
(
ctx
,
r
.
err
)
/*
if !xcontext.Canceled(r.err) {
r.stor.ResetLink(ctx)
m.updateNodeState(ctx, r.stor, proto.DOWN)
// XXX stop sending nodeTab/partTab updates to this node
}
*/
}
else
{
// we are interested in latest partTab
// NOTE during recovery no one must be subscribed to
// partTab so it is ok to simply change whole m.partTab
// TODO -> updatePartTab()
if
r
.
partTab
.
PTid
>
m
.
node
.
State
.
PartTab
.
PTid
{
m
.
node
.
State
.
PartTab
=
r
.
partTab
}
...
...
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