diff --git a/seaweed-block/core/host/master/services.go b/seaweed-block/core/host/master/services.go index 3aee9f4c1d..328710779e 100644 --- a/seaweed-block/core/host/master/services.go +++ b/seaweed-block/core/host/master/services.go @@ -125,9 +125,12 @@ func (s *services) CreateVolume(ctx context.Context, req *control.CreateVolumeRe if _, ok := head.Snapshots[spec.SourceSnapshot]; !ok { // A replay whose earlier attempt wrote the target's record and then // stopped (a crash, or a removal that failed) settles it here: a - // recorded dependent keeps its snapshot, so an absent snapshot - // proves the target was never recorded on the source, and nothing - // in the filer names it. The request tuple was matched above. + // recorded dependent keeps its snapshot, so an absent snapshot means + // no dependent of the target is recorded on the source now (one may + // have been, and released by the operator). Removing the record + // stays safe: a target's store directory is named by its id, so no + // later create reuses what this attempt may have written. The + // request tuple was matched above. if existing, ok := stores.Volumes.GetVolume(spec.VolumeID); ok && !existing.StoreReady && existing.Spec.SourceLayoutID == source.Spec.LayoutID { if err := undoRestoreRecord(s.host, spec.VolumeID); err != nil { return nil, status.Errorf(codes.Unavailable, "restore source snapshot %q is absent; the target's pending record was not removed: %v; retry", spec.SourceSnapshot, err)