Perform seqscan to fill LFC chunks with data so that on-disk file size included size of table (#10775)

## Problem

See https://github.com/neondatabase/neon/issues/10755

Random access pattern of pgbench leaves sparse chunks, which makes the
on-disk size of file.cache unpredictable.

## Summary of changes

Perform seqscan to fill LFC chunks with data so that on-disk file size
included size of table.

---------

Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech>
This commit is contained in:
Konstantin Knizhnik
2025-02-14 10:19:56 +02:00
committed by GitHub
parent 3e8bf2159d
commit 8bdb1828c8

View File

@@ -72,6 +72,11 @@ def test_lfc_resize(neon_simple_env: NeonEnv, pg_bin: PgBin):
thread.join()
# Fill LFC: seqscan should fetch the whole table in cache.
# It is needed for further correct evaluation of LFC file size
# (a sparse chunk of LFC takes less than 1 MB on disk).
cur.execute("select sum(abalance) from pgbench_accounts")
# Before shrinking the cache, check that it really is large now
(lfc_file_size, lfc_file_blocks) = get_lfc_size()
assert int(lfc_file_blocks) > 128 * 1024