diff --git a/seaweed-block/core/frontend/chunkstore/layout/delete_intent.go b/seaweed-block/core/frontend/chunkstore/layout/delete_intent.go index 625fdf5dee..08ff81c52b 100644 --- a/seaweed-block/core/frontend/chunkstore/layout/delete_intent.go +++ b/seaweed-block/core/frontend/chunkstore/layout/delete_intent.go @@ -172,6 +172,17 @@ func RunDeleteSnapshotWithIntent(ctx context.Context, st ListChainStore, base ui if !found || meta.Volume != h.VolumeID || meta.Session != deleteIntentWriter(base, ref) || meta.Mark != "" { return ErrPrecondition } + // Read the page again now that this run owns its tag. A stalled + // update from another run of the same delete can land between + // the read above and the adoption, putting a deleted page's data + // reference on this entry; once this run's tag is on it, no such + // update passes. An intent published over a page whose data is + // gone could never be consumed. + again := c + again.Ref = ref + if _, err := readListPage(ctx, st, h.VolumeID, again); err != nil { + return fmt.Errorf("%w: delete intent page changed during adoption: %v", ErrPrecondition, err) + } return nil }); err != nil { return Head{}, false, err