Commit 1ca427c0 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 71f7d77e
...@@ -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 is a process which implements 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment