Skip to content

Conversation

@Jille
Copy link
Contributor

@Jille Jille commented Oct 24, 2025

This allows bonanza to have (mutable) files backed by others. Bonanza
can use another FileReader to supply the data for all the "holes" in a
pool file.

Note that this requires some care to work correctly: If a file is
truncated to shrink and later extended again, the HoleSource must track
that and emit zeroes from offset of the smallest truncation.

So a future commit can still access the package by its name
@aspect-workflows
Copy link

aspect-workflows bot commented Oct 24, 2025

Test

1 test target passed

Targets
//pkg/filesystem/pool:pool_test [k8-fastbuild] 187ms

Total test execution time was 187ms. 18 tests (94.7%) were fully cached saving 3s.

This allows bonanza to have (mutable) files backed by others. Bonanza
can use another FileReader to supply the data for all the "holes" in a
pool file.

Note that this requires some care to work correctly: If a file is
truncated to shrink and later extended again, the HoleSource must track
that and emit zeroes from offset of the smallest truncation.
Right now we leave the size of the file set to zero, even if it was
created with a non-zero size. This causes the stats for these files to
be incorrect.
This is also the name of the underlying type.
Instead of simply returning the max() of the hole offsets of the file
and the hole source, we need to repeatedly check for holes in both
places. Only when we reach an offset where both locations correspond to
a hole, we may return.
Instead of writing null bytes, the write path must now also merge data
coming from the HoleSource. Otherwise we unintentially overwrite data
before/after the area to be written with null bytes.
I'd rather use mocking here, so that we ensure that we properly respect
the HoleSource instead of filling in null bytes ourselves.
@EdSchouten EdSchouten merged commit 5a4cb12 into buildbarn:main Oct 28, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants