Commit 31f4e061 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b84a150b
...@@ -418,8 +418,9 @@ func (m *Master) recovery(ctx context.Context) (err error) { ...@@ -418,8 +418,9 @@ 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++
// XXX wg.Add(1) + defer wg.Done() ? 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()
...@@ -655,20 +656,27 @@ func (m *Master) verify(ctx context.Context) (err error) { ...@@ -655,20 +656,27 @@ func (m *Master) verify(ctx context.Context) (err error) {
// NOTE we don't reset m.lastOid / m.lastTid to 0 in the beginning of verification // NOTE we don't reset m.lastOid / m.lastTid to 0 in the beginning of verification
// XXX (= py), rationale=? // XXX (= py), rationale=?
// goStorCtlVerify spawns verify task on a storage peer.
goStorCtlVerify := func(stor *_MasteredPeer) { goStorCtlVerify := func(stor *_MasteredPeer) {
// XXX rework
inprogress++ inprogress++
wg.Add(1) wg.Add(1)
go func() { stor.wg.Go(func(peerCtx context.Context) error {
defer wg.Done() defer wg.Done()
err := m.accept(node, state0, n.req, resp) var ...
if err != nil { err := stor.run(ctx, func() error {
verifyq <- storVerify{stor: node, err: err} ... = storCtlVerify(ctx, stor, m.node.State.PartTab)
return })
}
storCtlVerify(ctx, node, m.node.State.PartTab, verifyq) ack := make(chan struct{})
verifyq <- storVerify{stor: stor, ...}
<-ack
// canceled verify does not mean we should down the storage node
if xcontext.Canceled(err) {
err = nil
}
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