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
1ca427c0
Commit
1ca427c0
authored
May 30, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
71f7d77e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
go/neo/master.go
go/neo/master.go
+10
-6
No files found.
go/neo/master.go
View file @
1ca427c0
...
@@ -154,7 +154,7 @@ func (m *Master) xxx(ctx ...) {
...
@@ -154,7 +154,7 @@ func (m *Master) xxx(ctx ...) {
}
}
// run implements main master cluster management logic: node tracking, cluster
// run i
s a process which i
mplements main master cluster management logic: node tracking, cluster
// state updates, scheduling data movement between storage nodes etc
// state updates, scheduling data movement between storage nodes etc
func
(
m
*
Master
)
run
(
ctx
context
.
Context
)
{
func
(
m
*
Master
)
run
(
ctx
context
.
Context
)
{
...
@@ -216,10 +216,12 @@ func (m *Master) run(ctx context.Context) {
...
@@ -216,10 +216,12 @@ func (m *Master) run(ctx context.Context) {
// - monitor whether partition table becomes operational wrt currently up nodeset
// - monitor whether partition table becomes operational wrt currently up nodeset
// - if yes - finish recovering upon receiving "start" command
// - if yes - finish recovering upon receiving "start" command
// recovery
is a process that drives cluster via
recovery phase
// recovery
drives cluster during
recovery phase
//
//
// NOTE during recovery phase `recovery()` owns .partTab and .nodeTab XXX or is the only mutator ?
// when recovery finishes error indicates:
func
(
m
*
Master
)
recovery
(
ctx
context
.
Context
)
{
// - nil: recovery was ok and a command came for cluster to start
// - !nil: recovery was cancelled
func
(
m
*
Master
)
recovery
(
ctx
context
.
Context
)
error
{
recovery
:=
make
(
chan
storRecovery
)
recovery
:=
make
(
chan
storRecovery
)
rctx
,
rcancel
:=
context
.
WithCancel
(
ctx
)
rctx
,
rcancel
:=
context
.
WithCancel
(
ctx
)
defer
rcancel
()
defer
rcancel
()
...
@@ -286,7 +288,7 @@ loop:
...
@@ -286,7 +288,7 @@ loop:
rcancel
()
rcancel
()
defer
func
()
{
defer
func
()
{
s
<-
nil
c
.
resp
<-
nil
}()
}()
break
loop
break
loop
}
}
...
@@ -297,7 +299,7 @@ loop:
...
@@ -297,7 +299,7 @@ loop:
c
.
resp
<-
nil
// we are already recovering
c
.
resp
<-
nil
// we are already recovering
case
<-
ctx
.
Done
()
:
case
<-
ctx
.
Done
()
:
// XXX
err
=
ctx
.
Err
()
break
loop
break
loop
}
}
}
}
...
@@ -306,6 +308,8 @@ loop:
...
@@ -306,6 +308,8 @@ loop:
for
;
inprogress
>
0
;
inprogress
--
{
for
;
inprogress
>
0
;
inprogress
--
{
<-
recovery
<-
recovery
}
}
// XXX err
}
}
// storRecovery is result of a storage node passing recovery phase
// storRecovery is result of a storage node passing recovery phase
...
...
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