post workers: Fix skipped handling

This commit is contained in:
Łukasz Magiera 2022-01-21 10:39:14 +01:00
parent 4682e72cf4
commit 82c9e72aab
2 changed files with 9 additions and 14 deletions

View File

@ -162,14 +162,14 @@ func (m *Manager) generateWindowPoSt(ctx context.Context, minerID abi.ActorID, s
}
p, sk, err := m.generatePartitionWindowPost(cctx, spt, ppt, minerID, int(partIdx), sectors, randomness)
if len(sk) > 0 {
log.Errorf("generateWindowPost part:%d, skipped:%d, err: %+v", partIdx, len(sk), err)
flk.Lock()
skipped = append(skipped, sk...)
flk.Unlock()
}
if err != nil {
retErr = multierror.Append(retErr, xerrors.Errorf("partitionCount:%d err:%+v", partIdx, err))
if len(sk) > 0 {
log.Errorf("generateWindowPost groupCount:%d, skipped:%d, err: %+v", partIdx, len(sk), err)
flk.Lock()
skipped = append(skipped, sk...)
flk.Unlock()
}
return
}
@ -186,7 +186,6 @@ func (m *Manager) generateWindowPoSt(ctx context.Context, minerID abi.ActorID, s
if len(skipped) > 0 {
log.Warnf("GenerateWindowPoSt get skipped: %d", len(skipped))
return out, skipped, retErr
}
out = append(out, *postProofs)

View File

@ -560,7 +560,7 @@ func (l *LocalWorker) GenerateWindowPoSt(ctx context.Context, ppt abi.Registered
var wg sync.WaitGroup
wg.Add(len(sectors))
vproofs := make([][]byte, len(sectors))
vproofs := make([][]byte, 0, len(sectors))
for i, s := range sectors {
go func(i int, s storiface.PostSectorChallenge) {
@ -575,18 +575,14 @@ func (l *LocalWorker) GenerateWindowPoSt(ctx context.Context, ppt abi.Registered
Number: s.SectorNumber,
})
slk.Unlock()
log.Errorf("get sector: %d, vanilla: %s, offset: %d", s.SectorNumber, vanilla)
log.Errorf("get sector: %d, vanilla: %s, err: %s", s.SectorNumber, vanilla, err)
return
}
vproofs[i] = vanilla
vproofs = append(vproofs, vanilla)
}(i, s)
}
wg.Wait()
if len(skipped) > 0 {
panic("todo") // big TODO
}
res, err := sb.GenerateWindowPoStWithVanilla(ctx, ppt, mid, randomness, vproofs, partitionIdx)
return storiface.WindowPoStResult{