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) {
// goStorCtlRecovery spawns recovery task on a storage peer.
goStorCtlRecovery := func(stor *_MasteredPeer) {
inprogress++
// XXX wg.Add(1) + defer wg.Done() ?
wg.Add(1)
stor.wg.Go(func(peerCtx context.Context) error {
defer wg.Done()
ctx, cancel := xxcontext.Merge/*Cancel*/(ctx, peerCtx)
defer cancel()
......@@ -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
// XXX (= py), rationale=?
// goStorCtlVerify spawns verify task on a storage peer.
goStorCtlVerify := func(stor *_MasteredPeer) {
// XXX rework
inprogress++
wg.Add(1)
go func() {
stor.wg.Go(func(peerCtx context.Context) error {
defer wg.Done()
err := m.accept(node, state0, n.req, resp)
if err != nil {
verifyq <- storVerify{stor: node, err: err}
return
}
var ...
err := stor.run(ctx, func() error {
... = storCtlVerify(ctx, stor, m.node.State.PartTab)
})
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