diff --git a/seaweed-block/core/frontend/chunkstore/catalog.go b/seaweed-block/core/frontend/chunkstore/catalog.go index e20a4b62f3..39f5dc737a 100644 --- a/seaweed-block/core/frontend/chunkstore/catalog.go +++ b/seaweed-block/core/frontend/chunkstore/catalog.go @@ -1297,9 +1297,6 @@ func (c *Catalog) claimForkParent(ctx context.Context, req ForkRequest) (Snapsho return SnapshotInfo{}, catErr(CodeSnapshotDeleting, false, nil, "snapshot %s/%s is being deleted", req.Source, req.Snapshot) } claims := decodeClaims(ref.entry) - if red := true; red { // RED: no claim written - return ref.info, nil - } for _, cl := range claims { if cl == token { return ref.info, nil diff --git a/seaweed-block/core/frontend/chunkstore/retention.go b/seaweed-block/core/frontend/chunkstore/retention.go index a10790b8a7..bff617f678 100644 --- a/seaweed-block/core/frontend/chunkstore/retention.go +++ b/seaweed-block/core/frontend/chunkstore/retention.go @@ -361,10 +361,8 @@ func (c *Catalog) Retain(ctx context.Context, vol string, dryRun bool) (Retentio } for _, s := range unfinished { d := RetentionDecision{Name: s.Name, Attempt: s.attempt, CreatedNs: s.CreatedNs, Class: s.Class, Pinned: s.Pinned(), Reasons: []string{SnapDeleting}} - if red := true; !red { // RED: unfinished attempts not listed - res.Decisions = append(res.Decisions, d) - res.Expired++ - } + res.Decisions = append(res.Decisions, d) + res.Expired++ expired = append(expired, d) } if dryRun { @@ -454,8 +452,9 @@ func (c *Catalog) deleteRetainedAttempt(ctx context.Context, vol, name, attempt next.Extended[extSnapState] = []byte(SnapDeleting) next.Extended[extSnapDeletedNs] = []byte(strconv.FormatInt(c.now().UnixNano(), 10)) err = c.f.UpdateEntry(ctx, dir, next, map[string][]byte{ - extSnapState: []byte(SnapActive), // RED: no claims condition - extSnapGen: e.Extended[extSnapGen], + extSnapState: []byte(SnapActive), + extSnapGen: e.Extended[extSnapGen], + extSnapClaims: nil, // no claims: a fork that claimed meanwhile wins }) if errors.Is(err, ErrPrecondition) || errors.Is(err, ErrNotFound) { continue // a claim, a delete or a replacement landed: decide again