mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 02:27:26 +01:00
docs(master): an absent snapshot means no dependent is recorded now; removal is safe by the id-named directory
Comment only: a dependent may have been recorded and released by the operator before the snapshot was deleted. No code change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1ec0404d9d
commit
c07097238b
1 file changed
+6
-3
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user