Skip to content

Commit df0a8d9

Browse files
authored
Merge pull request #5759 from filecoin-project/asr/terminate-livecheck
Check liveness of sectors when processing termination batches
2 parents d11f2de + 47064f9 commit df0a8d9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

extern/storage-sealing/terminate_batch.go

+12
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,18 @@ func (b *TerminateBatcher) processBatch(notif, after bool) (*cid.Cid, error) {
143143
continue
144144
}
145145

146+
ps, err := b.api.StateMinerPartitions(b.mctx, b.maddr, loc.Deadline, nil)
147+
if err != nil {
148+
log.Warnw("TerminateBatcher: getting miner partitions", "deadline", loc.Deadline, "partition", loc.Partition, "error", err)
149+
continue
150+
}
151+
152+
toTerminate, err = bitfield.IntersectBitField(ps[loc.Partition].LiveSectors, toTerminate)
153+
if err != nil {
154+
log.Warnw("TerminateBatcher: intersecting liveSectors and toTerminate bitfields", "deadline", loc.Deadline, "partition", loc.Partition, "error", err)
155+
continue
156+
}
157+
146158
if total+n > uint64(miner.AddressedSectorsMax) {
147159
n = uint64(miner.AddressedSectorsMax) - total
148160

0 commit comments

Comments
 (0)