Skip to content

Commit 0243f4a

Browse files
committed
fix: include first sector in toRemove before continue on actor-not-found
The continue skipped toRemove.Set() for the first sector discovered for a dead miner. Subsequent sectors were fine since they bypassed the if-block. Now explicitly set the first sector before continuing.
1 parent 016a70d commit 0243f4a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tasks/gc/storage_gc_mark.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,10 @@ func (s *StorageGCMark) Do(taskID harmonytask.TaskID, stillOwned func() bool) (d
125125
if err != nil {
126126
if isActorNotFoundErr(err) {
127127
// Miner actor no longer exists on-chain. Sector files for this
128-
// miner are orphaned — skip loading state so that all its sectors
128+
// miner are orphaned — don't load state so that all its sectors
129129
// remain in toRemove (no precommit/live/unproven subtraction).
130130
log.Warnw("miner actor not found on-chain, treating sectors as orphaned for GC", "miner", maddr)
131+
toRemove[decl.Miner].Set(uint64(decl.Number))
131132
continue
132133
}
133134
return false, xerrors.Errorf("get miner actor %s: %w", maddr, err)

0 commit comments

Comments
 (0)