Check liveness of sectors when processing termination batches
This commit is contained in:
parent
9f721bfde5
commit
47064f987c
12
extern/storage-sealing/terminate_batch.go
vendored
12
extern/storage-sealing/terminate_batch.go
vendored
@ -143,6 +143,18 @@ func (b *TerminateBatcher) processBatch(notif, after bool) (*cid.Cid, error) {
|
||||
continue
|
||||
}
|
||||
|
||||
ps, err := b.api.StateMinerPartitions(b.mctx, b.maddr, loc.Deadline, nil)
|
||||
if err != nil {
|
||||
log.Warnw("TerminateBatcher: getting miner partitions", "deadline", loc.Deadline, "partition", loc.Partition, "error", err)
|
||||
continue
|
||||
}
|
||||
|
||||
toTerminate, err = bitfield.IntersectBitField(ps[loc.Partition].LiveSectors, toTerminate)
|
||||
if err != nil {
|
||||
log.Warnw("TerminateBatcher: intersecting liveSectors and toTerminate bitfields", "deadline", loc.Deadline, "partition", loc.Partition, "error", err)
|
||||
continue
|
||||
}
|
||||
|
||||
if total+n > uint64(miner.AddressedSectorsMax) {
|
||||
n = uint64(miner.AddressedSectorsMax) - total
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user