fix(datastore): report freed bytes from the remote parent reapers (S20-A lifecycle purger plan: 20b/24, stack: 3/5)
What this MR does
MavenRemotePackageReaper, NpmRemotePackageReaper and ContainerRemoteImageReaper now report freed bytes and a RepositoryID.
- Each reaper resolves its repository before the row goes, through the routes from !3401 (merged).
- Each reaper sums the bytes that its chunk freed, deduplicated within the repository. The npm arm uses the npm remote size family from !3401 (merged).
- If
TombstoneRow.SkipFreedBytesis set, each arm reports zero bytes anduuid.Nil. The repository walk sets it on every row. docs/dev/storage-accounting.mdnow says what each arm reports. It also says that the walk is still the only route to these arms.internal/datastore/lifecycle_reap_repository.goand.md: the reaper census and the walk shape are corrected.
The walk is the only route to these three arms on main.
Thus a repository purge reports the same totals as before.
!3380 (merged) adds the scan levels that give these arms a second route.
Stack
This MR is part 3 of 5. The parts split !3380 (merged), and they merge in this order:
- !3399 (merged): the Danger exemption for comment-only Go changes.
- !3401 (merged): the resolve routes and the npm remote size family.
- This MR: the three reapers report freed bytes.
- !3403 (merged): the three tombstone discovery scans.
- !3380 (merged): the three purge levels and the documentation.
Tests
| Test | What it holds |
|---|---|
TestContainerRemoteImageReaper_Reap_ReportsTheRepositoryScopedBytes |
A digest that another image of the repository holds frees nothing. A digest that nothing holds frees its size. A copy in a neighbor repository holds nothing. A walk row reports zero bytes and uuid.Nil. |
TestMavenRemotePackageReaper_Reap_ReportsTheRepositoryScopedBytes |
The same cases for the Maven arm, with version-ful and version-less cache files. |
TestNpmRemotePackageReaper_Reap_ReportsTheRepositoryScopedBytes |
The same cases for the npm arm, across npm_remote_files and npm_remote_metadata_files. |
| The three reapers' existing suites | Each now asserts the RepositoryID that the reaper names. |
Size
This MR has 790 reviewable lines: production Go 121, Go tests 610, Markdown 59. The tests are most of the size. Each arm's freed-byte suite needs sized blobs and a survivor row for each case. A split by arm gives three MRs, and each one changes the same doc passages and the same test helpers.
E2e scenario catalogs and user documentation
No scenario row and no docs/user/ page changes. The only route to these arms reports the same totals as before.
Related to #728 (closed)