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
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
534b777c
Commit
534b777c
authored
Aug 18, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0e4fc73e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
go/neo/server/cluster_test.go
go/neo/server/cluster_test.go
+4
-1
go/neo/server/master.go
go/neo/server/master.go
+28
-2
No files found.
go/neo/server/cluster_test.go
View file @
534b777c
...
...
@@ -331,8 +331,11 @@ func TestMasterStorage(t *testing.T) {
// verification ok; M start service
tc
.
Expect
(
clusterState
(
&
M
.
clusterState
,
neo
.
ClusterRunning
))
// TODO ^^^ should be sent to S
tc
.
Expect
(
conntx
(
"m:2"
,
"s:2"
,
1
,
&
neo
.
StartOperation
{
Backup
:
false
}))
tc
.
Expect
(
conntx
(
"s:2"
,
"m:2"
,
1
,
&
neo
.
NotifyReady
{})
// M.clusterState <- RUNNING + TODO it should be sent to S
// TODO S leave while service
// TODO S join while service
...
...
go/neo/server/master.go
View file @
534b777c
...
...
@@ -759,6 +759,12 @@ func storCtlVerify(ctx context.Context, stor *neo.Node, pt *neo.PartitionTable,
//
// TODO also plan data movement on new storage nodes appearing
// nodeServiced is the error returned after service-phase node handling is finished
type
nodeServiced
{
node
*
neoNode
err
error
}
// service drives cluster during running state
//
// TODO document error meanings on return
...
...
@@ -771,6 +777,7 @@ func (m *Master) service(ctx context.Context) (err error) {
ctx
,
cancel
:=
context
.
WithCancel
(
ctx
)
defer
cancel
()
service
:=
make
(
wg
:=
&
sync
.
WaitGroup
{}
// spawn per-storage service driver
...
...
@@ -817,6 +824,7 @@ loop:
}
}()
// XXX who sends here?
case
n
:=
<-
m
.
nodeLeave
:
m
.
nodeTab
.
SetNodeState
(
n
.
node
,
neo
.
DOWN
)
...
...
@@ -849,7 +857,7 @@ loop:
// storCtlService drives a storage node during cluster service state
// XXX text
func
storCtlService
(
ctx
context
.
Context
,
stor
*
neo
.
Node
,
srv
chan
service
XXX
)
{
func
storCtlService
(
ctx
context
.
Context
,
stor
*
neo
.
Node
,
srv
chan
service
Err
)
{
/*
var err error
defer func() {
...
...
@@ -861,10 +869,28 @@ func storCtlService(ctx context.Context, stor *neo.Node, srv chan serviceXXX) {
*/
conn
:=
stor
.
Conn
// XXX send nodeTab ?
// XXX send clusterInformation ?
ready
:=
neo
.
NotifyReady
{}
err
=
conn
.
Ask
(
&
neo
.
StartOperation
{
Backup
:
false
},
&
ready
)
if
err
!=
nil
{
// XXX ...
return
err
}
// now wait in a loop
// XXX this should be also controlling transactions
for
{
select
{
// XXX stub
case
<-
time
.
After
(
1
*
time
.
Second
)
:
println
(
"."
)
case
<-
ctx
.
Done
()
:
// XXX also send StopOperation?
break
loop
}
}
}
// identify processes identification request of just connected node and either accepts or declines it.
...
...
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