Skip to content

docs: fix arithmetic in build cache GC policy example - #26016

Merged
dvdksn merged 1 commit into
docker:mainfrom
sunm2n:docs-gc-policy-example-arithmetic
Sep 4, 2026
Merged

dvdksn merged 1 commit into
docker:mainfrom
sunm2n:docs-gc-policy-example-arithmetic

Conversation

@sunm2n

@sunm2n sunm2n commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Description

The GC policy example in content/manuals/build/cache/garbage-collection.md
defines the first policy as:

Find "stale" cache records that haven't been used in the past 48 hours, and
delete records until there's maximum 5GB of "stale" cache left.

It then walks through a sweep over 11GB of cache (7GB stale, 4GB other) and
concludes:

A GC sweep would delete 5GB of stale cache as part of the 1st policy, with a
remainder of 6GB, meaning the 2nd policy does not need to clear any more cache.

Both numbers contradict the policy as defined. Keeping a maximum of 5GB of
stale cache means deleting 2GB of the 7GB, which leaves 5GB stale plus 4GB
other, for 9GB in total.

The 6GB figure is internally consistent only with the opposite reading —
"delete 5GB of stale cache", leaving 2GB stale plus 4GB other. That reading is
what the sentence asserts, and it is not what the policy says, so the two
numbers are wrong together rather than independently.

The example's point survives the correction: 9GB is still under the second
policy's 10GB limit, so the second policy does not need to clear any more
cache.

-A GC sweep would delete 5GB of stale cache as part of the 1st policy, with a
-remainder of 6GB, meaning the 2nd policy does not need to clear any more cache.
+A GC sweep would delete 2GB of stale cache as part of the 1st policy, leaving
+9GB of cache in total, meaning the 2nd policy does not need to clear any more
+cache.

Note for the reporter of #25927: the "delete 2GB" half of the report is right,
but the report also says the "remainder of 6GB" is correct. It isn't —
11GB minus 2GB is 9GB. 6GB only follows from the misreading being corrected
here.

Related issues or tickets

Fixes #25927

Reviews

  • Technical review
  • Editorial review
  • Product review

🤖 Generated with Claude Code

https://claude.ai/code/session_01TGSfAZyRTEw9qGGzVECGYk

The GC policy example defines the first policy as "delete records until
there's maximum 5GB of stale cache left", then describes a sweep over 11GB
of cache (7GB stale, 4GB other) as deleting 5GB and leaving 6GB.

Both numbers contradict the policy as defined. Keeping a maximum of 5GB of
stale cache means deleting 2GB of the 7GB, which leaves 5GB stale plus 4GB
other, for 9GB in total. The 6GB figure only follows from reading the policy
as "delete 5GB", which is the opposite of what it says.

The example's point is unchanged: 9GB is still under the second policy's
10GB limit, so the second policy does not need to clear any more cache.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TGSfAZyRTEw9qGGzVECGYk
Signed-off-by: Sunmin Lee <134378502+sunm2n@users.noreply.github.com>
@sunm2n
sunm2n requested a review from dvdksn as a code owner September 4, 2026 08:46
@netlify

netlify Bot commented Sep 4, 2026

Copy link
Copy Markdown

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 14fc992
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/6a9a857cc685770008460760
😎 Deploy Preview https://deploy-preview-26016--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the area/build Relates to Dockerfiles or docker build command label Sep 4, 2026

@dvdksn dvdksn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know where my head was when I wrote this the first time, thanks for fixing it.

@dvdksn
dvdksn merged commit dba9db9 into docker:main Sep 4, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Relates to Dockerfiles or docker build command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

garbage collection policy documentation

2 participants