Commit 34b85fe0 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 7aa13998
...@@ -390,7 +390,6 @@ func (m *Master) recovery(ctx context.Context) (err error) { ...@@ -390,7 +390,6 @@ func (m *Master) recovery(ctx context.Context) (err error) {
recoveredq := make(chan storRecovery) // <- result of 1 stor recovery recoveredq := make(chan storRecovery) // <- result of 1 stor recovery
inprogress := 0 // in-progress stor recoveries inprogress := 0 // in-progress stor recoveries
// wg := &sync.WaitGroup{}
// requests to .ctlStart received when readyToStart // requests to .ctlStart received when readyToStart
// on success answered when full recovery completes // on success answered when full recovery completes
...@@ -450,9 +449,7 @@ func (m *Master) recovery(ctx context.Context) (err error) { ...@@ -450,9 +449,7 @@ func (m *Master) recovery(ctx context.Context) (err error) {
// goStorCtlRecovery spawns recovery task on a storage peer. // goStorCtlRecovery spawns recovery task on a storage peer.
goStorCtlRecovery := func(stor *_MasteredPeer) { goStorCtlRecovery := func(stor *_MasteredPeer) {
inprogress++ inprogress++
// wg.Add(1)
stor.wg.Go(func(peerCtx context.Context) error { stor.wg.Go(func(peerCtx context.Context) error {
// defer wg.Done()
ctx, cancel := xxcontext.Merge/*Cancel*/(ctx, peerCtx) ctx, cancel := xxcontext.Merge/*Cancel*/(ctx, peerCtx)
defer cancel() defer cancel()
...@@ -568,35 +565,6 @@ func (m *Master) recovery(ctx context.Context) (err error) { ...@@ -568,35 +565,6 @@ func (m *Master) recovery(ctx context.Context) (err error) {
} }
} }
/*
// wait all workers to finish (which should come without delay since it was cancelled)
// XXX not good - some of the rest of the storages can fail in the
// meantime and this will lead to partTab to become non-opertional.
// XXX also: some of the recoveries could still _succeed_ (e.g.
// successfuly recovery send was already queued to recoveredq but not
// yet received) - this successful recovery could bring us newer
// partTab fro which we should reconsider whether we have all needed
// nodes up and running.
done := make(chan struct{})
go func() {
wg.Wait()
close(done)
}()
loop2:
for {
select {
case r := <-recoveredq:
close(r.ack)
log.Error(ctx, r.err)
case <-done:
break loop2
}
}
*/
if err != nil { if err != nil {
return err return err
} }
......
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