sealing pipeline: Fix PC1 retry loop
This commit is contained in:
parent
2ddb52e103
commit
d127208b85
@ -31,7 +31,7 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error {
|
|||||||
|
|
||||||
cw := cbg.NewCborWriter(w)
|
cw := cbg.NewCborWriter(w)
|
||||||
|
|
||||||
if _, err := cw.Write([]byte{184, 38}); err != nil {
|
if _, err := cw.Write([]byte{184, 39}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -565,6 +565,22 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// t.PreCommit1Fails (uint64) (uint64)
|
||||||
|
if len("PreCommit1Fails") > cbg.MaxLength {
|
||||||
|
return xerrors.Errorf("Value in field \"PreCommit1Fails\" was too long")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PreCommit1Fails"))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := io.WriteString(w, string("PreCommit1Fails")); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.PreCommit1Fails)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// t.PreCommit2Fails (uint64) (uint64)
|
// t.PreCommit2Fails (uint64) (uint64)
|
||||||
if len("PreCommit2Fails") > cbg.MaxLength {
|
if len("PreCommit2Fails") > cbg.MaxLength {
|
||||||
return xerrors.Errorf("Value in field \"PreCommit2Fails\" was too long")
|
return xerrors.Errorf("Value in field \"PreCommit2Fails\" was too long")
|
||||||
@ -1402,6 +1418,21 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
|||||||
t.UpdateUnsealed = &c
|
t.UpdateUnsealed = &c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// t.PreCommit1Fails (uint64) (uint64)
|
||||||
|
case "PreCommit1Fails":
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
maj, extra, err = cr.ReadHeader()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if maj != cbg.MajUnsignedInt {
|
||||||
|
return fmt.Errorf("wrong type for uint64 field")
|
||||||
|
}
|
||||||
|
t.PreCommit1Fails = uint64(extra)
|
||||||
|
|
||||||
}
|
}
|
||||||
// t.PreCommit2Fails (uint64) (uint64)
|
// t.PreCommit2Fails (uint64) (uint64)
|
||||||
case "PreCommit2Fails":
|
case "PreCommit2Fails":
|
||||||
|
@ -182,6 +182,8 @@ func (evt SectorSealPreCommit1Failed) FormatError(xerrors.Printer) (next error)
|
|||||||
func (evt SectorSealPreCommit1Failed) apply(si *SectorInfo) {
|
func (evt SectorSealPreCommit1Failed) apply(si *SectorInfo) {
|
||||||
si.InvalidProofs = 0 // reset counter
|
si.InvalidProofs = 0 // reset counter
|
||||||
si.PreCommit2Fails = 0
|
si.PreCommit2Fails = 0
|
||||||
|
|
||||||
|
si.PreCommit1Fails++
|
||||||
}
|
}
|
||||||
|
|
||||||
type SectorSealPreCommit2Failed struct{ error }
|
type SectorSealPreCommit2Failed struct{ error }
|
||||||
|
@ -54,7 +54,13 @@ func (m *Sealing) checkPreCommitted(ctx statemachine.Context, sector SectorInfo)
|
|||||||
return info, true
|
return info, true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var MaxPreCommit1Retries = uint64(3)
|
||||||
|
|
||||||
func (m *Sealing) handleSealPrecommit1Failed(ctx statemachine.Context, sector SectorInfo) error {
|
func (m *Sealing) handleSealPrecommit1Failed(ctx statemachine.Context, sector SectorInfo) error {
|
||||||
|
if sector.PreCommit1Fails > MaxPreCommit1Retries {
|
||||||
|
return ctx.Send(SectorRemove{})
|
||||||
|
}
|
||||||
|
|
||||||
if err := failedCooldown(ctx, sector); err != nil {
|
if err := failedCooldown(ctx, sector); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,8 @@ type SectorInfo struct {
|
|||||||
TicketEpoch abi.ChainEpoch
|
TicketEpoch abi.ChainEpoch
|
||||||
PreCommit1Out storiface.PreCommit1Out
|
PreCommit1Out storiface.PreCommit1Out
|
||||||
|
|
||||||
|
PreCommit1Fails uint64
|
||||||
|
|
||||||
// PreCommit2
|
// PreCommit2
|
||||||
CommD *cid.Cid
|
CommD *cid.Cid
|
||||||
CommR *cid.Cid // SectorKey
|
CommR *cid.Cid // SectorKey
|
||||||
|
Loading…
Reference in New Issue
Block a user