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
dd1540ff
Commit
dd1540ff
authored
Feb 08, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e6e0ecb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
go/neo/master.go
go/neo/master.go
+12
-6
No files found.
go/neo/master.go
View file @
dd1540ff
...
...
@@ -33,6 +33,7 @@ import (
"sync"
"time"
xxcontext
"lab.nexedi.com/kirr/go123/xcontext"
"lab.nexedi.com/kirr/go123/xnet"
"lab.nexedi.com/kirr/go123/xsync"
...
...
@@ -378,6 +379,7 @@ loop:
// FIXME if identify=ok -> subscribe to δ(nodeTab) and send initial nodeTab right after accept (accept should do it?)
node
,
state0
,
resp
:=
m
.
identify
(
ctx
,
n
,
/* XXX only accept storages -> PENDING */
)
// XXX -> move to identify (spawn under peerWork.wg) ?
if
node
==
nil
{
goreject
(
ctx
,
wg
,
n
.
req
,
resp
)
break
...
...
@@ -389,15 +391,17 @@ loop:
go
func
()
{
defer
wg
.
Done
()
/*
// start recovery
var
pt
*
xneo
.
PartitionTable
err := acceptAndRun(func(node *_PeerNode) error {
err
:=
acceptAndRun
(
func
(
workCtx
context
.
Context
,
node
*
xneo
.
PeerNode
)
error
{
ctx
,
cancel
:=
xxcontext
.
Merge
/*Cancel*/
(
ctx
,
workCtx
)
defer
cancel
()
pt
,
err
=
storCtlRecovery
(
ctx
,
node
)
return
err
})
recevery <- storRecovery{stor: node, partTab: pt, err: err}
*/
recovery
<-
storRecovery
{
stor
:
node
,
partTab
:
pt
,
err
:
err
}
/*
err := m.accept(node, state0, n.req, resp)
if err != nil {
recovery <- storRecovery{stor: node, err: err}
...
...
@@ -406,6 +410,7 @@ loop:
// start recovery
storCtlRecovery(ctx, node, recovery)
*/
}()
// XXX <-m.nodeLeave
...
...
@@ -1266,10 +1271,11 @@ func (m *Master) accept(peer *xneo.PeerNode, state0 *xneo.ClusterStateSnapshot,
// XXX send clusterState too? (NEO/py does not send it)
var
w
*
peerWork
// XXX stub <- = .peerWorkTab[peer.NID] set from main
// go proxy δstate ... XXX
// XXX under which wg? -> under per-peer wg
wg
.
Go
(
func
(
ctx
context
.
Context
)
(
err
error
)
{
w
.
w
g
.
Go
(
func
(
ctx
context
.
Context
)
(
err
error
)
{
defer
task
.
Runningf
(
&
ctx
,
"send cluster updates"
)(
&
err
)
stateCode
:=
state0
.
Code
...
...
@@ -1281,7 +1287,7 @@ func (m *Master) accept(peer *xneo.PeerNode, state0 *xneo.ClusterStateSnapshot,
case
<-
ctx
.
Done
()
:
return
ctx
.
Err
()
case
δstate
=
<-
notifyq
:
// XXX could be also closed?
case
δstate
=
<-
w
.
notifyq
:
// XXX could be also closed?
}
var
msg
proto
.
Msg
...
...
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