diff --git a/seaweed-block/core/frontend/chunkstore/catalog.go b/seaweed-block/core/frontend/chunkstore/catalog.go index 6f643676ea..c3fbf1653e 100644 --- a/seaweed-block/core/frontend/chunkstore/catalog.go +++ b/seaweed-block/core/frontend/chunkstore/catalog.go @@ -834,7 +834,7 @@ func (c *Catalog) CreateSnapshot(ctx context.Context, vol string, req SnapshotRe } doc := snapDoc{Format: snapFormat, VolumeID: vol, Name: req.Name, RequestID: req.RequestID, CreatedNs: c.now().UnixNano(), CreatedBy: req.CreatedBy, Consistency: consistency, Head: headEnt.Content, Geometry: v.Geometry, Parent: v.Parent, - Labels: req.Labels, ExpiresAtNs: req.ExpiresAtNs, Class: ""} // RED: class not stored + Labels: req.Labels, ExpiresAtNs: req.ExpiresAtNs, Class: req.Class} body, err := json.Marshal(doc) if err != nil { return SnapshotInfo{}, err diff --git a/seaweed-block/core/frontend/chunkstore/retention.go b/seaweed-block/core/frontend/chunkstore/retention.go index a02b920712..27283b9d44 100644 --- a/seaweed-block/core/frontend/chunkstore/retention.go +++ b/seaweed-block/core/frontend/chunkstore/retention.go @@ -56,9 +56,6 @@ const ( ) func validSnapshotClass(class string) error { - if red := true; red { // RED: no validation - return nil - } switch class { case "", SnapshotClassSemantic, SnapshotClassPinned: return nil @@ -136,9 +133,6 @@ func (c *Catalog) volumeEntry(ctx context.Context, vol string) (*filerpb.Entry, // is conditional on the policy revision read, so of two concurrent setters // one wins and the other gets a retryable remote error. func (c *Catalog) SetRetentionPolicy(ctx context.Context, vol string, p RetentionPolicy) error { - if red := true; red { // RED: stores nothing - return nil - } if err := p.validate(); err != nil { return err } @@ -191,13 +185,6 @@ const ( // are ranked newest first; equal creation times rank by name, so the plan // is deterministic. func planRetention(p RetentionPolicy, snaps []SnapshotInfo, needed map[string]bool, now time.Time) []RetentionDecision { - if red := true; red { // RED: keeps everything - out := make([]RetentionDecision, len(snaps)) - for i, s := range snaps { - out[i] = RetentionDecision{Name: s.Name, Keep: true, Reasons: []string{"red"}} - } - return out - } ordered := append([]SnapshotInfo(nil), snaps...) sort.SliceStable(ordered, func(i, j int) bool { if ordered[i].CreatedNs != ordered[j].CreatedNs { @@ -336,9 +323,6 @@ func (c *Catalog) allSnapshots(ctx context.Context, vol string) ([]SnapshotInfo, // real published HEAD yet (absent or aborted). A published fork HEAD pins // its chunks for GC itself, so it no longer needs the snapshot. func (c *Catalog) forkParentsNeeded(ctx context.Context, vol string) (map[string]bool, error) { - if red := true; red { // RED: no fork needs a parent - return map[string]bool{}, nil - } vols, err := c.ListVolumes(ctx) if err != nil { return nil, err diff --git a/seaweed-block/core/frontend/chunkstore/usage.go b/seaweed-block/core/frontend/chunkstore/usage.go index b4120fb473..52b7fdf9d0 100644 --- a/seaweed-block/core/frontend/chunkstore/usage.go +++ b/seaweed-block/core/frontend/chunkstore/usage.go @@ -73,9 +73,6 @@ func chunkSize(g Geometry, idx uint64) uint64 { // Usage computes vol's space accounting. func (c *Catalog) Usage(ctx context.Context, vol string) (VolumeUsage, error) { - if red := true; red { // RED: no accounting - return VolumeUsage{VolumeID: vol, Snapshots: []SnapshotUsage{}}, nil - } v, ok, err := c.ReadVolume(ctx, vol) if err != nil { return VolumeUsage{}, err