Files
Alexey Milovidov bc34412258 Address the AI review: cover the aligned reserve-ahead path of use_real_disk_size
`test_cache_size` only asserted the completed-segment projection of the contract: by the
time it reads `FilesystemCacheSize`, every touched file segment is fully downloaded, so
`reserved_size == downloaded_size` and a bug in the block-aligned accounting of the
reserve-ahead surplus would leave the test green.

Add `test_cache_size_partial_segment_reserve_ahead`, which uses a cache disk with an
explicit 4Mi `reserve_granularity` and reads a single granule out of a table whose column
files are several times larger. That leaves the file segment in the
`reserved_size > downloaded_size` state, so completing it has to return
`alignFileSize(reserved_size) - alignFileSize(downloaded_size)` rather than the raw
difference; the test pins both `FilesystemCacheSize` and `current_size` in
`system.filesystem_cache_settings` to the block-aligned downloaded footprint, and asserts
that the read really was partial.

Also disable background download in `test_cache_size` so nothing can fill the cache
between reading the metric and computing the expectation, and state in a comment which
part of the contract that test covers.
2026-09-02 08:03:13 +00:00
..
2025-06-16 12:43:25 +03:00