Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/diagrams/cache-volume-room.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: New cache volume · room
---
stateDiagram-v2
direction TB
classDef ok stroke-width:1.6px
classDef fail stroke-width:1.6px

[*] --> count : new cache needed
state count <<choice>>
count --> create : [fewer than 64]
count --> evict : [64, one unreferenced]
count --> refused : [64, all referenced]
evict --> count : oldest deleted, no force
create --> [*]
refused --> [*]

note right of evict
Unreferenced: no receipt that
is not removed, no native
receipt, no quarantine record.
end note
note right of refused
graph_cache_capacity: remove
the data of a project you
no longer use.
end note

class create ok
class refused fail
Binary file added docs/diagrams/cache-volume-room.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions docs/diagrams/cache-volume-room.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion docs/guides/native-candidate.md
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,14 @@ once instead of reusing the shared one. Any other edit to another service, such
environment value on the app, keeps the cache. An edit to one of those inputs,
including a lockfile, selects the cache for the new identity as a fresh `up` would, so the initializer installs into it; the old cache
is shared and is only released by this run. Each such `up` publishes the current
source snapshot. A retained named volume is never reused as a dependency cache:
source snapshot. A pool keeps at most 64 dependency cache volumes. When a new one is
needed at that bound, cache volumes that nothing refers to are deleted, oldest
created first, to make room (HACK-2576): no graph receipt that is not removed, no native-authored
receipt and no cache quarantine record names them, and the engine refuses to delete
one a container still uses. A retained run always finds every cache it recorded.
Only when every cache is still referred to does `hack up` refuse with
`graph_cache_capacity`, and it says to remove the data of a project you no longer
use. A retained named volume is never reused as a dependency cache:
declaring one refuses and names the service and the `hack.dependencies.cache-volume`
field. Caches recorded by earlier builds, whose identity also covered the whole
Compose file, are kept while that file is unchanged and replaced once on the first
Expand Down
Loading
Loading