carlos / platform Public

assetcache: final-review fixes (admission order, sample race, Open budget, stuck unlinks)

Four Important findings from the whole-branch review, fixed together:

1. Free-space sample race. admit now reads a release counter
   (s.releases, ticked on every reservation release by Commit or Abort)
   before its free-space sample and samples again if it moved before the
   decision, so a fill that commits behind the sample is never counted
   nowhere. After sampleTries (4) overtaken samples it samples with s.mu
   held. Proved by TestReserveResamplesWhenACommitLandsAfterItsSample,
   which commits a fill from a hook between sample and decision.

2. Admission order. A reservation eviction cannot help is refused
   before anything is evicted: larger than the budget, not fitting
   beside other fills' reservations and the retired bytes, or refused by
   the floor on the current sample. Only an errShort (the budget alone
   short) evicts, and then every rule is checked again on a fresh sample.
   The spec's budget, 15% floor and fair share are unchanged.

3. Open enforces a lowered budget by evicting with the fair-share rule.
   If deletions fail, Open still succeeds, over budget, and Reserve
   refuses every fill with ErrNoRoom (retrying the deletions) until the
   store is back under. Documented on Open.

4. Reserve retries stuck unlinks before refusing for want of room, and
   Retain retries them even over an empty index.

Minors: a direct decodeMeta overflow test, a statfs missing-directory
test, the Retain race test now provably overlaps the fills, and restart
recency is seeded from StoredAt.

Census: Fill.commit, Open and Store.scan changed bodies with the same
reads; their fingerprints, the internal/assetcache envelope (93ba49fd)
and the seal (1fa408dd) are recomputed, the chain line updated and the
approval card refreshed. Rows keep rev3=census-ruling-edge-asset-cache-2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 7ab21e8fb4493f719cbf2c3d65222c04e8c21a2b parent e68b83c
12 files changed, +621 −51
  • docs/superpowers/notes/census-proposal-edge-asset-cache-2.md +15 −2
  • internal/assetcache/entry_test.go +7 −6
  • internal/assetcache/evict.go +8 −3
  • internal/assetcache/evict_test.go +185 −5
  • internal/assetcache/fill.go +104 −19
  • internal/assetcache/fill_test.go +74 −0
  • internal/assetcache/fs.go +2 −1
  • internal/assetcache/fs_linux_test.go +16 −1
  • internal/assetcache/store.go +32 −5
  • internal/assetcache/store_test.go +170 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-edge-asset-cache-2.tsv +7 −7

CI passed — run details

diff --git a/docs/superpowers/notes/census-proposal-edge-asset-cache-2.md b/docs/superpowers/notes/census-proposal-edge-asset-cache-2.md
index 25ae256fd..9250fd56c 100644
--- a/docs/superpowers/notes/census-proposal-edge-asset-cache-2.md
+++ b/docs/superpowers/notes/census-proposal-edge-asset-cache-2.md
@@ -25,6 +25,19 @@ registry, a unit file or anything another component writes. None makes a
root decision. A `.meta` that does not parse is deleted with its files,
never trusted.
+This card is refreshed for the final-review fix wave: admission order,
+the free-space sample race, the budget enforced at `Open`, and the retry
+of failed unlinks. Three units' bodies changed. Their reads did not:
+
+- `Fill.commit` releases its reservation through the helper that ticks
+ the release counter.
+- `Open` evicts down to the budget after the scan.
+- `Store.scan` indexes the oldest `StoredAt` first.
+
+Their digests and `@legacy` fingerprints, the envelope and the seal are
+recomputed. No read was added or removed. The 17 rows are otherwise as
+before.
+
## Decisions (the census owner's call)
Every row is class `new`. Proposed disposition for all 17: class `legacy`,
@@ -58,10 +71,10 @@ one of the scanner's read names. Name matches only, with no real read: `Open`,
| `statfs_other.go` `var Statfs` | new | +file:Statfs | the variable's name; off Linux `Space` returns `ErrUnsupported` and reads nothing | no, name match only |
Envelopes pinned: `internal/assetcache` (new,
-`375fe495911e30962c53e74dea86b519d35151df67fcf0f73baef5ff654a4342`).
+`93ba49fd3716984a753682f88739cdc3dc3efed459a0892c831a2232f7250ece`).
Seal: `0ca3baafa26f59c0b7d8c6d6a39237d074afb71f885b7fbd50debebab5bf89f2` →
-`1a971f24a0cbc73337438c5b9e1012c099051191c72a6ef4e3ae353270525643`.
+`1fa408dd8db3757fa1dbfdafff978a7c2d40bb28285f7c8192920ef384ae6827`.
Overlay: `internal/provision/testdata/plan14-root-reads-edge-asset-cache-2.tsv`,
appended to `internal/provision/testdata/plan14-root-reads-chain.tsv` after
diff --git a/internal/assetcache/entry_test.go b/internal/assetcache/entry_test.go
index e39613e6d..b1d24b7ad 100644
--- a/internal/assetcache/entry_test.go
+++ b/internal/assetcache/entry_test.go
@@ -352,8 +352,9 @@ func TestCommitOfAFailedFillAborts(t *testing.T) {
}
// heldBytesRefuse checks that, with a reader holding retired bytes, a fill
-// that fits only by counting them as free is refused (after evicting every
-// other entry), and that it is admitted once the reader closes.
+// that fits only by counting them as free is refused without evicting
+// anything (no eviction can free held bytes), and that it is admitted once
+// the reader closes.
func heldBytesRefuse(t *testing.T, s *Store, held int64, r *Reader, wantBody []byte) {
t.Helper()
st := s.Stats()
@@ -370,9 +371,9 @@ func heldBytesRefuse(t *testing.T, s *Store, held int64, r *Reader, wantBody []b
if _, err := s.Reserve(probe, n); !errors.Is(err, ErrNoRoom) {
t.Fatalf("Reserve(%d) with %d bytes held = %v, want ErrNoRoom", n, held, err)
}
- // The refused fill evicted what it could; the held bytes remain.
- if st1 := s.Stats(); st1.Entries != 0 || st1.Bytes != held || st1.Retired != held {
- t.Fatalf("Stats after the refusal = %+v, want no entries and only the %d held bytes", st1, held)
+ // The refused fill evicted nothing; the held bytes remain.
+ if st1 := s.Stats(); st1 != st {
+ t.Fatalf("Stats after the refusal = %+v, want %+v unchanged", st1, st)
}
// The reader still reads the unlinked bytes.
got, err := io.ReadAll(r)
@@ -382,7 +383,7 @@ func heldBytesRefuse(t *testing.T, s *Store, held int64, r *Reader, wantBody []b
if err := r.Close(); err != nil {
t.Fatal(err)
}
- if st2 := s.Stats(); st2.Retired != 0 || st2.Bytes != 0 {
+ if st2 := s.Stats(); st2.Retired != 0 || st2.Bytes != st.Bytes-held {
t.Fatalf("Stats after Close = %+v, want nothing held", st2)
}
f, err := s.Reserve(probe, n)
diff --git a/internal/assetcache/evict.go b/internal/assetcache/evict.go
index a7877eccb..3cd095efc 100644
--- a/internal/assetcache/evict.go
+++ b/internal/assetcache/evict.go
@@ -5,8 +5,10 @@ package assetcache
// Budget), or until nothing is left to evict. Each round takes the least
// recently used entry of the app furthest over its share. Bytes that open
// Readers hold stay counted (drop keeps them), so room can stay short; the
-// caller's budget check decides. It is called without s.mu held and takes
-// s.mu only to choose a victim, never across the deletion.
+// caller's budget check decides. Reserve calls it only for a reservation
+// that fits once room is made, and Open with need 0 to bring a store found
+// over its budget back under. It is called without s.mu held and takes s.mu
+// only to choose a victim, never across the deletion.
func (s *Store) makeRoom(need int64) {
var failed map[*entry]bool // victims drop could not delete; not chosen again
for {
@@ -74,8 +76,11 @@ func (s *Store) shareOf(apps int) int64 {
// deleted. keep is called without any store lock held, once per entry that
// was indexed when Retain began; an entry committed meanwhile is not judged.
// An entry a Reader holds is deleted like any other: its files go at once
-// and its bytes stay counted until the Reader closes.
+// and its bytes stay counted until the Reader closes. Retain first retries
+// the unlinks that failed earlier, so a sweep frees their disk even when
+// there is no entry left for it to judge.
func (s *Store) Retain(keep func(Key) bool) int {
+ s.retryStuck()
s.mu.Lock()
all := make([]*entry, 0, len(s.entries))
for _, e := range s.entries {
diff --git a/internal/assetcache/evict_test.go b/internal/assetcache/evict_test.go
index ef96231d3..828e2feeb 100644
--- a/internal/assetcache/evict_test.go
+++ b/internal/assetcache/evict_test.go
@@ -3,6 +3,8 @@ package assetcache
import (
"errors"
"fmt"
+ "os"
+ "path/filepath"
"strings"
"sync"
"testing"
@@ -211,12 +213,19 @@ func TestRetainDeletesRejectedKeys(t *testing.T) {
func TestEvictionRacesFillsGetsAndRetain(t *testing.T) {
s, _ := evictStore(t)
body := evictBody
- var wg sync.WaitGroup
+ // Retain rejects every worker's fourth entry. It starts at the first
+ // commit and runs until the last fill is done, and each worker waits
+ // after committing its fourth entry until that entry is gone, so Retain
+ // deletes while the other workers' fills are in flight.
+ rejected := func(k Key) bool { return strings.HasSuffix(k.Path, "-3") }
+ firstCommit, fillsDone := make(chan struct{}), make(chan struct{})
+ var once sync.Once
+ var fills, wg sync.WaitGroup
for _, app := range []string{"shop", "blog"} {
for w := 0; w < 3; w++ {
- wg.Add(1)
+ fills.Add(1)
go func() {
- defer wg.Done()
+ defer fills.Done()
for i := 0; i < 15; i++ {
k := testKey(app, fmt.Sprintf("/w%d-%d", w, i))
f, err := s.Reserve(k, int64(len(body)))
@@ -232,19 +241,46 @@ func TestEvictionRacesFillsGetsAndRetain(t *testing.T) {
if err := f.Commit(Meta{Header: cssHeader("1"), Lifetime: time.Hour, Expires: testNow.Add(time.Hour)}, false); err != nil {
t.Errorf("Commit: %v", err)
}
+ once.Do(func() { close(firstCommit) })
+ if rejected(k) {
+ for deadline := time.Now().Add(10 * time.Second); present(s, app, k.Path); time.Sleep(time.Millisecond) {
+ if time.Now().After(deadline) {
+ t.Errorf("%s %s still indexed while Retain runs", app, k.Path)
+ break
+ }
+ }
+ }
s.Get(testKey(app, fmt.Sprintf("/w%d-%d", w, i/2)))
}
}()
}
}
+ go func() {
+ fills.Wait()
+ close(fillsDone)
+ }()
+ deleted := 0
wg.Add(1)
go func() {
defer wg.Done()
- for i := 0; i < 10; i++ {
- s.Retain(func(k Key) bool { return k.Path != "/w0-3" })
+ select {
+ case <-firstCommit:
+ case <-fillsDone:
+ return
+ }
+ for {
+ select {
+ case <-fillsDone:
+ return
+ default:
+ deleted += s.Retain(func(k Key) bool { return !rejected(k) })
+ }
}
}()
wg.Wait()
+ if deleted == 0 {
+ t.Fatal("Retain deleted nothing while the fills ran")
+ }
s.mu.Lock()
defer s.mu.Unlock()
@@ -270,3 +306,147 @@ func TestEvictionRacesFillsGetsAndRetain(t *testing.T) {
t.Fatalf("lists hold %d entries, index %d", listed, len(s.entries))
}
}
+
+// mustKeepEverything fails unless every entry and byte in before is still
+// there: a refused reservation evicted nothing.
+func mustKeepEverything(t *testing.T, s *Store, before Stats) {
+ t.Helper()
+ if after := s.Stats(); after != before {
+ t.Fatalf("Stats after the refusal = %+v, want %+v: nothing evicted", after, before)
+ }
+}
+
+// TestReserveLargerThanTheBudgetEvictsNothing is not acceptance: it uses a
+// fake FS. With a valid 32 MiB budget a fill of unknown length reserves
+// about 64 MiB, which no eviction can make room for: it is refused before
+// anything is evicted for it.
+func TestReserveLargerThanTheBudgetEvictsNothing(t *testing.T) {
+ s, _, _ := entryStore(t, 32<<20)
+ commitN(t, s, "shop", "s", 3)
+ commitN(t, s, "blog", "b", 2)
+ before := s.Stats()
+ if _, err := s.Reserve(testKey("shop", "/big"), -1); !errors.Is(err, ErrNoRoom) {
+ t.Fatalf("err = %v, want ErrNoRoom", err)
+ }
+ mustKeepEverything(t, s, before)
+}
+
+// TestReserveCrowdedOutByOtherFillsEvictsNothing is not acceptance: it uses
+// a fake FS. The reservation fits the budget alone, but not beside another
+// fill's outstanding reservation, which eviction cannot free.
+func TestReserveCrowdedOutByOtherFillsEvictsNothing(t *testing.T) {
+ s, _ := evictStore(t)
+ commitN(t, s, "shop", "s", 5)
+ a, err := s.Reserve(testKey("blog", "/a"), 300000)
+ if err != nil {
+ t.Fatal(err)
+ }
+ before := s.Stats()
+ if _, err := s.Reserve(testKey("shop", "/b"), 200000); !errors.Is(err, ErrNoRoom) {
+ t.Fatalf("err = %v, want ErrNoRoom", err)
+ }
+ mustKeepEverything(t, s, before)
+ a.Abort()
+ b, err := s.Reserve(testKey("shop", "/b"), 200000)
+ if err != nil {
+ t.Fatalf("after the other fill aborted: %v", err)
+ }
+ b.Abort()
+}
+
+// TestReserveBelowTheFloorEvictsNothing is not acceptance: it uses a fake
+// FS. The store is full enough that the fill would have to evict, but the
+// disk is at its floor, so it is refused before anything is evicted.
+func TestReserveBelowTheFloorEvictsNothing(t *testing.T) {
+ s, _ := evictStore(t)
+ fs := s.cfg.FS.(*fakeFS)
+ commitN(t, s, "shop", "s", 40) // about 80% of the budget
+ fs.mu.Lock()
+ fs.total = 8 << 30
+ fs.mu.Unlock()
+ fs.setFree(8 << 30 * floorPercent / 100)
+ before := s.Stats()
+ if _, err := s.Reserve(testKey("blog", "/b"), int64(len(bigBody))); !errors.Is(err, ErrBelowFloor) {
+ t.Fatalf("err = %v, want ErrBelowFloor", err)
+ }
+ mustKeepEverything(t, s, before)
+ // With room on the disk the same fill evicts and is admitted.
+ fs.setFree(4 << 30)
+ f, err := s.Reserve(testKey("blog", "/b"), int64(len(bigBody)))
+ if err != nil {
+ t.Fatalf("with room on the disk: %v", err)
+ }
+ defer f.Abort()
+ mustBeGone(t, s, "shop", "/s0")
+ mustFitBudget(t, s)
+}
+
+// stuckBody commits one 100000-byte entry into a 300000-byte store, makes its
+// body impossible to unlink (the name becomes a directory holding a file, so
+// remove fails) and deletes the entry: its .meta goes, its body is stuck and
+// its bytes stay counted. It returns the file whose removal clears the fault.
+func stuckBody(t *testing.T) (*Store, string) {
+ t.Helper()
+ s, _, dir := entryStore(t, 300000)
+ k := testKey("shop", "/a.css")
+ commit(t, s, k, bigBody, cssHeader("1"), false)
+ body := filepath.Join(dir, bodyName(k.ID(), mustGet(t, s, k).Meta.Version))
+ if err := os.Remove(body); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.Mkdir(body, 0o700); err != nil {
+ t.Fatal(err)
+ }
+ pin := filepath.Join(body, "pin")
+ writeFile(t, pin, []byte("x"))
+ if n := s.Retain(func(Key) bool { return false }); n != 1 {
+ t.Fatalf("Retain = %d, want the entry deleted", n)
+ }
+ if st := s.Stats(); st.Entries != 0 || st.Retired != int64(len(bigBody)) || st.Bytes != st.Retired {
+ t.Fatalf("Stats = %+v, want only the stuck body counted", st)
+ }
+ return s, pin
+}
+
+// TestReserveRetriesAFailedUnlinkBeforeRefusing is not acceptance: it uses a
+// fake FS. A body whose unlink failed holds bytes no eviction can free. While
+// the fault lasts the fill is refused; once it clears, the same reservation
+// succeeds with no other commit or deletion in between, because Reserve
+// retries the unlink before it concludes there is no room.
+func TestReserveRetriesAFailedUnlinkBeforeRefusing(t *testing.T) {
+ s, pin := stuckBody(t)
+ before := s.Stats()
+ // 2*90000 + metaReserve fits the budget, but not beside the stuck body.
+ probe := testKey("blog", "/b.css")
+ if _, err := s.Reserve(probe, 90000); !errors.Is(err, ErrNoRoom) {
+ t.Fatalf("while the unlink fails: err = %v, want ErrNoRoom", err)
+ }
+ mustKeepEverything(t, s, before)
+ if err := os.Remove(pin); err != nil {
+ t.Fatal(err)
+ }
+ f, err := s.Reserve(probe, 90000)
+ if err != nil {
+ t.Fatalf("once the fault cleared: %v", err)
+ }
+ defer f.Abort()
+ if st := s.Stats(); st.Retired != 0 || st.Bytes != 0 {
+ t.Fatalf("Stats = %+v, want the stuck body gone", st)
+ }
+}
+
+// TestRetainRetriesAFailedUnlinkOnAnEmptyIndex is not acceptance: it uses a
+// fake FS. The sweep retries stuck unlinks even when there is no entry left
+// for it to judge.
+func TestRetainRetriesAFailedUnlinkOnAnEmptyIndex(t *testing.T) {
+ s, pin := stuckBody(t)
+ if err := os.Remove(pin); err != nil {
+ t.Fatal(err)
+ }
+ if n := s.Retain(func(Key) bool { return true }); n != 0 {
+ t.Fatalf("Retain = %d, want 0", n)
+ }
+ if st := s.Stats(); st.Retired != 0 || st.Bytes != 0 {
+ t.Fatalf("Stats = %+v, want the stuck body gone", st)
+ }
+}
diff --git a/internal/assetcache/fill.go b/internal/assetcache/fill.go
index fb4d7b78e..6821550ff 100644
--- a/internal/assetcache/fill.go
+++ b/internal/assetcache/fill.go
@@ -29,6 +29,10 @@ const (
// floorPercent is the share of the filesystem that must stay free.
floorPercent = 15
+
+ // sampleTries is how many free-space samples admit takes without the
+ // store's lock before it takes one with the lock held.
+ sampleTries = 4
)
var (
@@ -90,6 +94,14 @@ type leftover struct {
// the origin announced; negative means unknown. It sets aside twice the body
// (identity plus gzip copy) and metaReserve, taking the body as MaxBody when
// the length is unknown.
+//
+// A reservation that eviction cannot help is refused before anything is
+// evicted for it: one larger than the budget, one that does not fit beside
+// the other fills' reservations and the retired bytes no eviction frees, and
+// one the free-space floor refuses. Only a reservation that the budget alone
+// stands in the way of evicts, and then every condition is checked again on
+// a fresh free-space sample. Before it refuses for want of room, Reserve
+// retries the unlinks that failed earlier, whose bytes are still counted.
func (s *Store) Reserve(k Key, contentLength int64) (*Fill, error) {
if contentLength > MaxBody {
return nil, ErrTooLarge
@@ -100,6 +112,7 @@ func (s *Store) Reserve(k Key, contentLength int64) (*Fill, error) {
}
res := reservation{identity: n, gzip: n, meta: metaReserve}
scope := k.AppScope()
+ r := res.total()
s.mu.Lock()
err := s.busyLocked(scope)
@@ -108,17 +121,28 @@ func (s *Store) Reserve(k Key, contentLength int64) (*Fill, error) {
return nil, err
}
- total, free, err := s.cfg.FS.Space(s.cfg.Dir)
- if err != nil {
- return nil, fmt.Errorf("assetcache: free space: %w", err)
- }
-
- s.makeRoom(res.total())
-
- if err := s.admit(scope, res.total(), total, free); err != nil {
- return nil, err
+ retried, evicted := false, false
+ for {
+ err := s.admit(scope, r)
+ if err == nil {
+ break
+ }
+ if !errors.Is(err, ErrNoRoom) && !errors.Is(err, errShort) {
+ return nil, err
+ }
+ if !retried {
+ retried = true
+ if s.retryStuck() {
+ continue
+ }
+ }
+ if errors.Is(err, ErrNoRoom) || evicted {
+ return nil, ErrNoRoom
+ }
+ s.makeRoom(r)
+ evicted = true
}
- f := &Fill{s: s, key: k, scope: scope, id: k.ID(), res: res, held: res.total()}
+ f := &Fill{s: s, key: k, scope: scope, id: k.ID(), res: res, held: r}
if err := f.open(); err != nil {
f.finish()
return nil, err
@@ -134,24 +158,77 @@ func (s *Store) busyLocked(scope string) error {
return nil
}
-// admit checks the bounds, the budget and the floor together and, if all
-// hold, claims the reservation and a fill slot. total and free are the
-// filesystem's size and free bytes as just measured.
-func (s *Store) admit(scope string, r int64, total, free uint64) error {
- s.mu.Lock()
- defer s.mu.Unlock()
+// errShort is admit's answer when only the budget stands in the way, and
+// evicting entries can make the room.
+var errShort = errors.New("assetcache: no room in the budget until entries are evicted")
+
+// admit takes a free-space sample and decides on it whether a reservation of
+// r bytes for scope may start. If it may, admit claims the reservation and a
+// fill slot and returns nil; otherwise it returns the refusal, or errShort.
+//
+// The sample and the reservation counter must agree. A fill that commits
+// between the sample and the decision releases its reservation, and the
+// bytes it wrote after the sample are then in neither, so a decision that
+// combined the two would count them nowhere. Every release ticks
+// s.releases, and admit samples again when the count moved; after
+// sampleTries unlocked samples it samples with s.mu held, where nothing can
+// release. A reservation claimed meanwhile only raises the counter, and a
+// fill still in flight writes inside a reservation the counter still holds,
+// so neither calls for a new sample.
+func (s *Store) admit(scope string, r int64) error {
+ for try := 1; ; try++ {
+ locked := try > sampleTries
+ s.mu.Lock()
+ releases := s.releases
+ if !locked {
+ s.mu.Unlock()
+ }
+ total, free, err := s.cfg.FS.Space(s.cfg.Dir)
+ if !locked {
+ if s.afterSample != nil {
+ s.afterSample()
+ }
+ s.mu.Lock()
+ }
+ if err != nil {
+ s.mu.Unlock()
+ return fmt.Errorf("assetcache: free space: %w", err)
+ }
+ if s.releases != releases {
+ s.mu.Unlock()
+ continue
+ }
+ err = s.decideLocked(scope, r, total, free)
+ s.mu.Unlock()
+ return err
+ }
+}
+
+// decideLocked applies the admission rules to one free-space sample, total
+// and free, in an order that keeps a reservation eviction cannot help from
+// evicting anything. If every rule holds it claims the reservation and a
+// fill slot. The caller holds s.mu.
+func (s *Store) decideLocked(scope string, r int64, total, free uint64) error {
if err := s.busyLocked(scope); err != nil {
return err
}
- if s.used > s.cfg.Budget-s.reserved-r { // used + reserved + r > Budget, without overflow
+ // The room eviction can make at most: the budget less the other fills'
+ // reservations and the retired bytes (held by Readers, by unlinks that
+ // failed, or kept for the next Open), none of which eviction frees.
+ if r > s.cfg.Budget || s.retired > s.cfg.Budget-s.reserved-r {
return ErrNoRoom
}
// Free space after every outstanding reservation and this one must stay
// at or above the floor. Reservations may already be partly written, so
- // this counts some bytes twice: it errs towards refusing.
+ // this counts some bytes twice: it errs towards refusing. The floor is
+ // judged on the disk as sampled: eviction makes room in the budget, so a
+ // fill the floor refuses evicts nothing.
if need := uint64(s.reserved) + uint64(r) + total*floorPercent/100; free < need {
return ErrBelowFloor
}
+ if s.used > s.cfg.Budget-s.reserved-r { // used + reserved + r > Budget, without overflow
+ return errShort
+ }
s.reserved += r
s.fills++
s.fillsByApp[scope]++
@@ -313,7 +390,15 @@ func (s *Store) releaseReserved(n int64) {
}
s.mu.Lock()
defer s.mu.Unlock()
+ s.releaseReservedLocked(n)
+}
+
+// releaseReservedLocked returns n reserved bytes and ticks s.releases, so an
+// admission that sampled free space before this release samples again (see
+// admit). The caller holds s.mu.
+func (s *Store) releaseReservedLocked(n int64) {
s.reserved -= n
+ s.releases++
}
// crashBeforeMetaRename is the Commit stage, for tests, after the meta
@@ -489,7 +574,7 @@ func (f *Fill) commit(m Meta, gzipCopy bool) error {
}
}
s.index(ne)
- s.reserved -= f.held
+ s.releaseReservedLocked(f.held)
s.releaseSlotLocked(f.scope)
s.mu.Unlock()
unlock()
diff --git a/internal/assetcache/fill_test.go b/internal/assetcache/fill_test.go
index fff17d350..ebe943689 100644
--- a/internal/assetcache/fill_test.go
+++ b/internal/assetcache/fill_test.go
@@ -6,6 +6,7 @@ import (
"os"
"sync"
"testing"
+ "time"
)
// fakeFS is a settable free-space source. Tests using it are not acceptance:
@@ -404,3 +405,76 @@ func TestAbortKeepsLeftoverBytesCountedAndRetries(t *testing.T) {
t.Fatalf("Reserved = %d after a third Abort", got)
}
}
+
+// TestReserveResamplesWhenACommitLandsAfterItsSample is not acceptance: it
+// uses a fake FS. A fill commits between another Reserve's free-space sample
+// and its decision. The committed bytes have left the reservation counter
+// and are not in the sample either, so a decision that combined the two
+// would count them nowhere. The numbers make that stale combination pass
+// the floor and a fresh sample fail it.
+func TestReserveResamplesWhenACommitLandsAfterItsSample(t *testing.T) {
+ s, fs, _ := fillStore(t)
+ const total = 8 << 30
+ floor := uint64(total) * floorPercent / 100
+ body := make([]byte, 1<<20)
+ onDisk := uint64(len(body)) + 4096 // what the fake disk loses when a commits
+ start := floor + worstReserve + onDisk/2
+ fs.total = total
+ fs.setFree(start)
+
+ a := fill(t, s, testKey("blog", "/a.css"), body)
+ samples := 0
+ s.afterSample = func() {
+ samples++
+ if samples > 1 {
+ return
+ }
+ if err := a.Commit(Meta{Header: cssHeader("1"), Lifetime: time.Hour, Expires: testNow.Add(time.Hour)}, false); err != nil {
+ t.Errorf("Commit: %v", err)
+ }
+ fs.setFree(start - onDisk)
+ }
+ f, err := s.Reserve(testKey("shop", "/b.css"), -1)
+ if err == nil {
+ f.Abort()
+ }
+ if !errors.Is(err, ErrBelowFloor) {
+ t.Fatalf("Reserve after a commit landed behind its sample: err = %v, want ErrBelowFloor", err)
+ }
+ if samples < 2 {
+ t.Fatalf("free space sampled %d times, want a second sample after the commit", samples)
+ }
+ if st := s.Stats(); st.Reserved != 0 || st.Entries != 1 {
+ t.Fatalf("Stats = %+v, want a's entry and nothing reserved", st)
+ }
+}
+
+// TestReserveDecidesUnderTheLockWhenReleasesKeepComing is not acceptance: it
+// uses a fake FS. Every unlocked sample is overtaken by a release, so after
+// sampleTries of them Reserve samples with the store locked, where nothing
+// can move the counter, and decides on that.
+func TestReserveDecidesUnderTheLockWhenReleasesKeepComing(t *testing.T) {
+ s, _, _ := fillStore(t)
+ var others []*Fill
+ for i := 0; i < sampleTries; i++ {
+ others = append(others, fill(t, s, testKey("blog", fmt.Sprintf("/%d", i)), []byte("x")))
+ }
+ samples := 0
+ s.afterSample = func() {
+ if samples < len(others) {
+ others[samples].Abort()
+ }
+ samples++
+ }
+ f, err := s.Reserve(testKey("shop", "/a.css"), 10)
+ if err != nil {
+ t.Fatalf("Reserve: %v", err)
+ }
+ f.Abort()
+ if samples != sampleTries {
+ t.Fatalf("unlocked samples = %d, want %d and then one under the lock", samples, sampleTries)
+ }
+ if st := s.Stats(); st.Reserved != 0 {
+ t.Fatalf("Reserved = %d after every fill aborted", st.Reserved)
+ }
+}
diff --git a/internal/assetcache/fs.go b/internal/assetcache/fs.go
index 7f44ba32e..84c7d2280 100644
--- a/internal/assetcache/fs.go
+++ b/internal/assetcache/fs.go
@@ -6,7 +6,8 @@ import "errors"
// implementation is statfs; tests may supply a fake.
type FS interface {
// Space reports the size of the filesystem holding dir and the bytes
- // available to an unprivileged writer.
+ // available to an unprivileged writer. The store may call it with its
+ // own lock held, so it must not call back into the Store.
Space(dir string) (total, free uint64, err error)
}
diff --git a/internal/assetcache/fs_linux_test.go b/internal/assetcache/fs_linux_test.go
index 120044d48..ebd616bb8 100644
--- a/internal/assetcache/fs_linux_test.go
+++ b/internal/assetcache/fs_linux_test.go
@@ -2,7 +2,10 @@
package assetcache
-import "testing"
+import (
+ "path/filepath"
+ "testing"
+)
// TestStatfsReportsTheTempDir is the acceptance test for the real FS: it asks
// the kernel about a real directory.
@@ -18,3 +21,15 @@ func TestStatfsReportsTheTempDir(t *testing.T) {
t.Fatalf("free %d > total %d", free, total)
}
}
+
+// TestStatfsFailsOnAMissingDirectory asks the kernel about a directory that
+// does not exist: the real FS returns the error and no totals.
+func TestStatfsFailsOnAMissingDirectory(t *testing.T) {
+ total, free, err := Statfs.Space(filepath.Join(t.TempDir(), "missing"))
+ if err == nil {
+ t.Fatal("Space of a missing directory succeeded")
+ }
+ if total != 0 || free != 0 {
+ t.Fatalf("Space of a missing directory = %d, %d, want 0, 0 with the error", total, free)
+ }
+}
diff --git a/internal/assetcache/store.go b/internal/assetcache/store.go
index 979958926..0289c5303 100644
--- a/internal/assetcache/store.go
+++ b/internal/assetcache/store.go
@@ -12,6 +12,7 @@ import (
"math"
"os"
"path/filepath"
+ "sort"
"strings"
"sync"
"time"
@@ -21,7 +22,7 @@ import (
type Config struct {
Dir string // the cache directory; created 0700
Budget int64 // bytes of entries (bodies and .meta files) the store may hold
- FS FS // free-space source
+ FS FS // free-space source; may be called with the store's lock held
Now func() time.Time // defaults to time.Now
}
@@ -94,17 +95,27 @@ type Store struct {
used int64 // bytes held by entries and retired versions
retired int64 // the part of used no indexed entry names
reserved int64 // bytes promised to fills in flight
+ releases uint64 // ticks whenever reserved bytes are released; see admit
fills int // fills in flight on this box
fillsByApp map[string]int // fills in flight by AppScope
useCount uint64 // ticks once per index and per Get hit
idLocks map[string]*idLock // by id, while held or awaited
stuck map[*version]struct{} // retired versions whose unlink failed
+
+ afterSample func() // tests only: called between admit's unlocked free-space sample and its decision
}
// Open creates the directory if needed and rebuilds the index from it.
// It removes whatever a crash can leave behind: temporaries, body files no
// parsed .meta names (orphans and superseded versions), and a .meta that
// does not parse or whose files are incomplete, together with its files.
+//
+// Recency starts from each entry's StoredAt, the oldest least recently used.
+// If what it finds is more than cfg.Budget (the budget was lowered since the
+// files were written), Open evicts by the fair-share rule until it fits. If
+// files it must delete for that cannot be deleted, Open still succeeds, over
+// its budget: it serves the entries it holds and refuses every fill with
+// ErrNoRoom until it is back under, each Reserve retrying the deletions.
func Open(cfg Config) (*Store, error) {
if cfg.Dir == "" {
return nil, errors.New("assetcache: no directory")
@@ -133,6 +144,7 @@ func Open(cfg Config) (*Store, error) {
if err := s.scan(); err != nil {
return nil, err
}
+ s.makeRoom(0)
return s, nil
}
@@ -160,6 +172,8 @@ func (s *Store) scan() error {
}
keep := make(map[string]bool) // body file names a parsed meta names
+ var found []*entry
+ var sum int64 // the bytes of found
for _, name := range metas {
id := strings.TrimSuffix(name, ".meta")
m, metaSize, valid, err := s.loadMeta(id)
@@ -177,9 +191,21 @@ func (s *Store) scan() error {
keep[gzipName(id, m.Version)] = true
}
e := newEntry(id, m, metaSize)
- if e.ver.bytes > math.MaxInt64-metaSize || s.used > math.MaxInt64-e.bytes() {
+ if e.ver.bytes > math.MaxInt64-metaSize || sum > math.MaxInt64-e.bytes() {
return errors.New("assetcache: indexed bytes overflow")
}
+ sum += e.bytes()
+ found = append(found, e)
+ }
+ // Index the oldest stored first, so it starts as the least recently used.
+ sort.Slice(found, func(i, j int) bool {
+ a, b := found[i], found[j]
+ if !a.meta.StoredAt.Equal(b.meta.StoredAt) {
+ return a.meta.StoredAt.Before(b.meta.StoredAt)
+ }
+ return a.id < b.id
+ })
+ for _, e := range found {
s.index(e)
}
for _, name := range files {
@@ -305,9 +331,9 @@ func (s *Store) unlink(v *version) {
s.settleLocked(v)
}
-// retryStuck retries the removal of versions whose unlink failed. It is
-// called without s.mu held.
-func (s *Store) retryStuck() {
+// retryStuck retries the removal of versions whose unlink failed, and
+// reports whether there were any to retry. It is called without s.mu held.
+func (s *Store) retryStuck() bool {
s.mu.Lock()
var vs []*version
for v := range s.stuck {
@@ -320,6 +346,7 @@ func (s *Store) retryStuck() {
for _, v := range vs {
s.unlink(v)
}
+ return len(vs) > 0
}
// settleLocked stops counting v's bytes once nothing holds them. The caller
diff --git a/internal/assetcache/store_test.go b/internal/assetcache/store_test.go
index a34415734..51e3ed379 100644
--- a/internal/assetcache/store_test.go
+++ b/internal/assetcache/store_test.go
@@ -1,6 +1,8 @@
package assetcache
import (
+ "errors"
+ "fmt"
"math"
"net/http"
"os"
@@ -24,6 +26,12 @@ func testConfig(dir string) Config {
// writeEntry writes an entry's files by hand in the documented layout:
// <id>.meta plus <id>.<v>.body and, when gz is non-empty, <id>.<v>.gz.
func writeEntry(t *testing.T, dir string, k Key, version string, body, gz []byte) Meta {
+ t.Helper()
+ return writeEntryAt(t, dir, k, version, body, gz, testNow)
+}
+
+// writeEntryAt is writeEntry with the entry stored at storedAt.
+func writeEntryAt(t *testing.T, dir string, k Key, version string, body, gz []byte, storedAt time.Time) Meta {
t.Helper()
m := Meta{
Key: k,
@@ -31,7 +39,7 @@ func writeEntry(t *testing.T, dir string, k Key, version string, body, gz []byte
Header: http.Header{"Content-Type": {"text/css"}},
Lifetime: time.Hour,
Expires: testNow.Add(time.Hour),
- StoredAt: testNow,
+ StoredAt: storedAt,
Size: int64(len(body)),
GzipSize: int64(len(gz)),
}
@@ -359,3 +367,164 @@ func TestOpenDropsMetaWithOverflowingSizes(t *testing.T) {
}
sameNames(t, listDir(t, dir), nil)
}
+
+// TestDecodeMetaRefusesOverflowingSizes checks the overflow guard on its own:
+// the Open test above also fails the body size check, so it would pass
+// without the guard.
+func TestDecodeMetaRefusesOverflowingSizes(t *testing.T) {
+ for _, c := range []struct {
+ size, gzip int64
+ ok bool
+ }{
+ {math.MaxInt64, 0, true},
+ {math.MaxInt64 - 1, 1, true},
+ {math.MaxInt64, 1, false},
+ {1, math.MaxInt64, false},
+ {math.MaxInt64, math.MaxInt64, false},
+ {-1, 0, false},
+ {0, -1, false},
+ } {
+ raw, err := encodeMeta(Meta{Key: testKey("shop", "/a.css"), Version: "a", Size: c.size, GzipSize: c.gzip})
+ if err != nil {
+ t.Fatal(err)
+ }
+ if _, err := decodeMeta(raw); (err == nil) != c.ok {
+ t.Errorf("decodeMeta with sizes %d and %d: err = %v, want ok=%v", c.size, c.gzip, err, c.ok)
+ }
+ }
+}
+
+// shopKeysByID returns n keys of app shop in the order Open's directory
+// listing finds their .meta files: by id.
+func shopKeysByID(n int) []Key {
+ keys := make([]Key, n)
+ for i := range keys {
+ keys[i] = testKey("shop", fmt.Sprintf("/%d.css", i))
+ }
+ sort.Slice(keys, func(i, j int) bool { return keys[i].ID() < keys[j].ID() })
+ return keys
+}
+
+// writeNewestFirst writes one entry per key, each an hour older than the one
+// before, so the first file name is the newest: an index that took recency
+// from file names would have it backwards.
+func writeNewestFirst(t *testing.T, dir string, keys []Key, body []byte) {
+ t.Helper()
+ for i, k := range keys {
+ writeEntryAt(t, dir, k, "a", body, nil, testNow.Add(-time.Duration(i)*time.Hour))
+ }
+}
+
+// TestOpenSeedsRecencyFromStoredAt: after a restart the least recently used
+// entry is the one stored longest ago, whatever its file name.
+func TestOpenSeedsRecencyFromStoredAt(t *testing.T) {
+ dir := t.TempDir()
+ keys := shopKeysByID(4)
+ writeNewestFirst(t, dir, keys, []byte("body"))
+ s := openStore(t, dir)
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ var got []Key
+ for el := s.apps["abc/shop"].lru.Front(); el != nil; el = el.Next() {
+ got = append(got, el.Value.(*entry).meta.Key)
+ }
+ for i := range keys {
+ if i >= len(got) || got[i] != keys[i] {
+ t.Fatalf("recency after Open, most recent first = %v, want %v (newest StoredAt first)", got, keys)
+ }
+ }
+}
+
+// overBudgetDir writes six shop entries and one blog entry of 20000 bytes
+// each, about 142 kB, for a store opened with a 100000-byte budget.
+func overBudgetDir(t *testing.T) (dir string, shop []Key, blog Key) {
+ t.Helper()
+ dir = t.TempDir()
+ body := []byte(strings.Repeat("x", 20000))
+ shop = shopKeysByID(6)
+ writeNewestFirst(t, dir, shop, body)
+ blog = testKey("blog", "/b.css")
+ writeEntryAt(t, dir, blog, "a", body, nil, testNow.Add(-24*time.Hour))
+ return dir, shop, blog
+}
+
+func smallBudgetStore(t *testing.T, dir string) (*Store, error) {
+ return Open(Config{Dir: dir, Budget: 100000, FS: &fakeFS{total: 64 << 30, free: 64 << 30}, Now: func() time.Time { return testNow }})
+}
+
+// TestOpenEnforcesASmallerBudget is not acceptance: it uses a fake FS. A
+// cache written under a larger budget is reopened under a smaller one. Open
+// evicts by the fair-share rule until it fits: from shop, the app furthest
+// over its share, oldest stored first, and nothing of blog, which is within
+// its share although its entry is the oldest of all.
+func TestOpenEnforcesASmallerBudget(t *testing.T) {
+ dir, shop, blog := overBudgetDir(t)
+ s, err := smallBudgetStore(t, dir)
+ if err != nil {
+ t.Fatalf("Open: %v", err)
+ }
+ st := s.Stats()
+ if st.Bytes > s.cfg.Budget || st.Retired != 0 {
+ t.Fatalf("Stats after Open = %+v, want within the budget %d", st, s.cfg.Budget)
+ }
+ if !present(s, "blog", blog.Path) {
+ t.Fatal("blog's entry was evicted, want kept: blog is within its share")
+ }
+ kept := 0
+ for kept < len(shop) && present(s, "shop", shop[kept].Path) {
+ kept++
+ }
+ for _, k := range shop[kept:] {
+ if present(s, "shop", k.Path) {
+ t.Fatalf("shop kept %s but evicted a newer entry", k.Path)
+ }
+ if _, err := os.Stat(filepath.Join(dir, metaName(k.ID()))); !os.IsNotExist(err) {
+ t.Fatalf("evicted %s still has its .meta: %v", k.Path, err)
+ }
+ }
+ if kept == 0 || kept == len(shop) {
+ t.Fatalf("shop kept %d of %d entries, want the newest few", kept, len(shop))
+ }
+ // Only as much as needed went: one more entry would not fit.
+ if one := 20000 + metaFile(t, dir, shop[0]); st.Bytes+one <= s.cfg.Budget {
+ t.Fatalf("Stats = %+v: room for another %d-byte entry, Open evicted too much", st, one)
+ }
+}
+
+// TestOpenOverBudgetRefusesFillsUntilBackUnder is not acceptance: it uses a
+// fake FS. When the entries Open would evict cannot be deleted (the
+// directory is read-only), Open still succeeds, over its budget, and every
+// fill is refused, each retrying the deletions, until the store is back
+// under its budget.
+func TestOpenOverBudgetRefusesFillsUntilBackUnder(t *testing.T) {
+ if os.Geteuid() == 0 {
+ t.Skip("root ignores directory permissions")
+ }
+ dir, _, _ := overBudgetDir(t)
+ if err := os.Chmod(dir, 0o500); err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { os.Chmod(dir, 0o700) })
+ s, err := smallBudgetStore(t, dir)
+ if err != nil {
+ t.Fatalf("Open over budget with undeletable entries: %v, want it to succeed", err)
+ }
+ if st := s.Stats(); st.Entries != 7 || st.Bytes <= s.cfg.Budget {
+ t.Fatalf("Stats = %+v, want all 7 entries, over the budget", st)
+ }
+ probe := testKey("blog", "/probe")
+ if _, err := s.Reserve(probe, 10); !errors.Is(err, ErrNoRoom) {
+ t.Fatalf("Reserve over budget: err = %v, want ErrNoRoom", err)
+ }
+ if err := os.Chmod(dir, 0o700); err != nil {
+ t.Fatal(err)
+ }
+ f, err := s.Reserve(probe, 10)
+ if err != nil {
+ t.Fatalf("Reserve once deletion works: %v", err)
+ }
+ defer f.Abort()
+ if st := s.Stats(); st.Bytes+st.Reserved > s.cfg.Budget {
+ t.Fatalf("Stats = %+v, want within the budget %d", st, s.cfg.Budget)
+ }
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 565edbbba..13e65c27b 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -4,4 +4,4 @@
plan14-root-reads-sec-host-imdsv2-module.tsv 945934f5978ace14dc5a9bae0ed69dfabf29b994504fc843c03d4a633ecd6c6a
plan14-root-reads-sec-deps-dos-bumps.tsv 945934f5978ace14dc5a9bae0ed69dfabf29b994504fc843c03d4a633ecd6c6a
plan14-root-reads-sec-sidecar-create-gate.tsv 0ca3baafa26f59c0b7d8c6d6a39237d074afb71f885b7fbd50debebab5bf89f2
-plan14-root-reads-edge-asset-cache-2.tsv 1a971f24a0cbc73337438c5b9e1012c099051191c72a6ef4e3ae353270525643
+plan14-root-reads-edge-asset-cache-2.tsv 1fa408dd8db3757fa1dbfdafff978a7c2d40bb28285f7c8192920ef384ae6827
diff --git a/internal/provision/testdata/plan14-root-reads-edge-asset-cache-2.tsv b/internal/provision/testdata/plan14-root-reads-edge-asset-cache-2.tsv
index 8aeb3beaa..5423345e7 100644
--- a/internal/provision/testdata/plan14-root-reads-edge-asset-cache-2.tsv
+++ b/internal/provision/testdata/plan14-root-reads-edge-asset-cache-2.tsv
@@ -1,7 +1,7 @@
# Census overlay edge-asset-cache-2 (plan 2 of the edge asset cache: the disk store, internal/assetcache), loaded LAST through plan14-root-reads-chain.tsv, after sec-sidecar-create-gate, the overlay main loads last at e3fd2e02. census-ruling-edge-asset-cache-2, put to the census owner before the merge; the approval card is docs/superpowers/notes/census-proposal-edge-asset-cache-2.md. Written by hand: every row is a new unit, a decision census-propose refuses.
# internal/assetcache is a new package that nothing imports yet (plan 3 wires it into the agent). Its 17 units read only the files it writes itself: <id>.meta, <id>.<v>.body, <id>.<v>.gz and their temporaries in the one directory a Store is opened over (plan 3 opens it at $CARLOS_DATA_DIR/asset-cache), plus a statfs of that directory for its free-space floor. No unit reads a record, a registry, a unit file or anything another component writes, and none makes a root decision, so each is accepted legacy with one basis. Reader.Read, ReadAt and Stat read the body file Entry.Open opened; statfs_other.go's Statfs reads nothing (ErrUnsupported off Linux) and is listed because the scan matches the name.
# Seventeen frozen declarations are added, so the seal moves; sec-sidecar-create-gate's seal is checked first. The internal/assetcache envelope is pinned for the first time.
-@legacy bc9d9dd4587d99363e51e76582a3b30ad19ef981342b3cdbab491b0d060996d4 internal/assetcache/fill.go Fill.commit legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Read@368 ad399b420f842b405306be2813eb14fbdc4efcf6968d6f0c7ebf592ff52c0649
+@legacy 98e0d339123d55c5425dd1cc46cb11305269fe4dea382bd952e51bdc23c7fde9 internal/assetcache/fill.go Fill.commit legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Read@368 e1b0bcb55f08f506fa87c7e35c96eabe7931c2b9b6923a164ddcced757eb4578
@legacy 19752c89f2353403a601b3b42b94440019e180b8639d2f7502c4947528523b0b internal/assetcache/fill.go Fill.finish legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Lstat@375 a37b9660dcdfc494c91fbd98b6f1b30cb5e56e009882a352898ccdb39168c5c0
@legacy 8ee80e2ff14aca0b8dd02cd6c0cc428477ef28a9d54abd1472f6478dae084502 internal/assetcache/fill.go Fill.open legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:OpenFile@309,file:Read@59 20bd23b8e51fdaef96f91c47d3bc7c49db3b2e22e83b358c8af5f9abd6f59d23
@legacy 0cd8d78a4626ac37b9890adc0f216287475656395e65f8cbb23e2a41377ba6c7 internal/assetcache/fill.go Fill.writeGzip legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:OpenFile@74 f6e320929321f37a3d1fa684927e442f368cc788a828ba6cf2c73aa5f5a2494e
@@ -11,14 +11,14 @@
@legacy ddae9d316f3a2eb6b79a9d9994fe5ed221114faf9fd28eadc24f2c0ec99a1551 internal/assetcache/statfs_linux.go var Statfs legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Statfs@4 3a576cd63f92cf882fff6676a56d5e0aac23dad84a74984a7f8b7e1ee9947074
@legacy 70434c3b959a3318e828edf97eb344fd404fcae75540029b386eb30972a21445 internal/assetcache/statfs_other.go var Statfs legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Statfs@4 3a576cd63f92cf882fff6676a56d5e0aac23dad84a74984a7f8b7e1ee9947074
@legacy 2cc26c595abb729312188f631f49e7fe8d29f02561447d2110436b3e438a73d9 internal/assetcache/store.go Entry.Open legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Open@16,file:Open@592 ad9287698f3128c134a7b88f286a67db616eaa3b2b56a8c984188ac2e0bcc673
-@legacy a66d905cb180bf87ba4019d07cee01ce26a37876df18a74943b267e68c741504 internal/assetcache/store.go Open legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Open@5,file:Statfs@281 624487c342a1064224e08422715737260afdf297dec7327170781c70d838a192
+@legacy 3796d50e1607cd7c5671196275617e70a0715a8ba31e3e0f3346d38b55e5c171 internal/assetcache/store.go Open legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Open@5,file:Statfs@281 4330bb540366aa9bd63495ecd41719dbbc43d72dca5b98e95b0b2f084da194ec
@legacy 44ed5af23a4380955271187ad27e4cc47fb1dcf0f4b2ff05665866f66f418a18 internal/assetcache/store.go Reader.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Read@17,file:Read@72 b35cc8c8d77c2133c5adb0020a23cf4cad1bebaf1ec2052f4154ad00f157a795
@legacy fdbf4eeccbd4ade4f98c32c11ef817e043f3028c7cdb2f75e4aabed94f2656d2 internal/assetcache/store.go Reader.ReadAt legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:ReadAt@17,file:ReadAt@72 7cbd07ec7d26ceb5c5eaa37dbce0dad37050beefc8910434ac48dd0189ddb350
@legacy 97ba7818979291752fe1550fe794689c2959dc8cb268214dbc7e529f55aec8db internal/assetcache/store.go Reader.Stat legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Stat@17,file:Stat@72 8ca5335393585b568da254987b859b4ef40e64e5c7c3bc774f414bf524944115
@legacy 5ae1ec871e9365388a61d0a99ef0d9a86f7de1699a48a088f3084bca586d89f2 internal/assetcache/store.go Store.bodyMatches legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Stat@81 56610feb6f7852a01c33b4e7dca1a8edc532c4a43cf319068b3f4f7bc09d71bb
@legacy 61bd84de05231e72dc0288d743297feaeff855722acac898f9efee3db79f7c83 internal/assetcache/store.go Store.loadMeta legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:ReadFile@99 9be068a53c11f8108b0586a15efd20053b7bf136daa482dc7db1a60ba182d4c6
-@legacy 266fd4201864729375d19aa9106d297ec7f56b3be781293ebe06f4b996d5a02d internal/assetcache/store.go Store.scan legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:ReadDir@45 347433001a025bbf1ecd81e8c5895c53fdae6af039583588eee37fb0c8a8f175
-internal/assetcache/fill.go Fill.commit legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Read@368 ad399b420f842b405306be2813eb14fbdc4efcf6968d6f0c7ebf592ff52c0649
+@legacy db36b88d73f2d8d821ec9d2b301119d99ad426ac9e788e4931f39c9b2b61b1b3 internal/assetcache/store.go Store.scan legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:ReadDir@45 55e39758f4cc22e673a1d30ae509af5431ab1e01a96181541e356482d4543918
+internal/assetcache/fill.go Fill.commit legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Read@368 e1b0bcb55f08f506fa87c7e35c96eabe7931c2b9b6923a164ddcced757eb4578
internal/assetcache/fill.go Fill.finish legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Lstat@375 a37b9660dcdfc494c91fbd98b6f1b30cb5e56e009882a352898ccdb39168c5c0
internal/assetcache/fill.go Fill.open legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:OpenFile@309,file:Read@59 20bd23b8e51fdaef96f91c47d3bc7c49db3b2e22e83b358c8af5f9abd6f59d23
internal/assetcache/fill.go Fill.writeGzip legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:OpenFile@74 f6e320929321f37a3d1fa684927e442f368cc788a828ba6cf2c73aa5f5a2494e
@@ -28,11 +28,11 @@ internal/assetcache/statfs_linux.go statfsFS.Space legacy accepted-legacy accept
internal/assetcache/statfs_linux.go var Statfs legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Statfs@4 3a576cd63f92cf882fff6676a56d5e0aac23dad84a74984a7f8b7e1ee9947074
internal/assetcache/statfs_other.go var Statfs legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Statfs@4 3a576cd63f92cf882fff6676a56d5e0aac23dad84a74984a7f8b7e1ee9947074
internal/assetcache/store.go Entry.Open legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Open@16,file:Open@592 ad9287698f3128c134a7b88f286a67db616eaa3b2b56a8c984188ac2e0bcc673
-internal/assetcache/store.go Open legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Open@5,file:Statfs@281 624487c342a1064224e08422715737260afdf297dec7327170781c70d838a192
+internal/assetcache/store.go Open legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Open@5,file:Statfs@281 4330bb540366aa9bd63495ecd41719dbbc43d72dca5b98e95b0b2f084da194ec
internal/assetcache/store.go Reader.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Read@17,file:Read@72 b35cc8c8d77c2133c5adb0020a23cf4cad1bebaf1ec2052f4154ad00f157a795
internal/assetcache/store.go Reader.ReadAt legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:ReadAt@17,file:ReadAt@72 7cbd07ec7d26ceb5c5eaa37dbce0dad37050beefc8910434ac48dd0189ddb350
internal/assetcache/store.go Reader.Stat legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Stat@17,file:Stat@72 8ca5335393585b568da254987b859b4ef40e64e5c7c3bc774f414bf524944115
internal/assetcache/store.go Store.bodyMatches legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:Stat@81 56610feb6f7852a01c33b4e7dca1a8edc532c4a43cf319068b3f4f7bc09d71bb
internal/assetcache/store.go Store.loadMeta legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:ReadFile@99 9be068a53c11f8108b0586a15efd20053b7bf136daa482dc7db1a60ba182d4c6
-internal/assetcache/store.go Store.scan legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:ReadDir@45 347433001a025bbf1ecd81e8c5895c53fdae6af039583588eee37fb0c8a8f175
-@coverage internal/assetcache 375fe495911e30962c53e74dea86b519d35151df67fcf0f73baef5ff654a4342
+internal/assetcache/store.go Store.scan legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-asset-cache-2;asset cache files under $CARLOS_DATA_DIR/asset-cache, written and read only by this package file:ReadDir@45 55e39758f4cc22e673a1d30ae509af5431ab1e01a96181541e356482d4543918
+@coverage internal/assetcache 93ba49fd3716984a753682f88739cdc3dc3efed459a0892c831a2232f7250ece