diff options
| author | Andres Freund | 2022-12-08 03:32:59 +0000 |
|---|---|---|
| committer | Andres Freund | 2022-12-08 03:32:59 +0000 |
| commit | d3b111e3205b6e681e16b4f8e6ed01f67142ce7b (patch) | |
| tree | cdbac630df05839fb164f6726115b9f8dd2369d5 /meson.build | |
| parent | bf07ab492c461460b4a69279abb2ef996b4f67ec (diff) | |
Add option to specify segment size in blocks
The tests don't have much coverage of segment related code, as we don't create
large enough tables. To make it easier to test these paths, add a new option
specifying the segment size in blocks.
Set the new option to 6 blocks in one of the CI tasks. Smaller numbers
currently fail one of the tests, for understandable reasons.
While at it, fix some segment size related issues in the meson build.
Author: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/20221107171355.c23fzwanfzq2pmgt@awork3.anarazel.de
Diffstat (limited to 'meson.build')
| -rw-r--r-- | meson.build | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/meson.build b/meson.build index 3cb50c0b17..3cc941c7f3 100644 --- a/meson.build +++ b/meson.build @@ -419,7 +419,19 @@ meson_bin = find_program(meson_binpath, native: true) cdata.set('USE_ASSERT_CHECKING', get_option('cassert') ? 1 : false) -cdata.set('BLCKSZ', get_option('blocksize').to_int() * 1024, description: +blocksize = get_option('blocksize').to_int() * 1024 + +if get_option('segsize_blocks') != 0 + if get_option('segsize') != 1 + warning('both segsize and segsize_blocks specified, segsize_blocks wins') + endif + + segsize = get_option('segsize_blocks') +else + segsize = (get_option('segsize') * 1024 * 1024 * 1024) / blocksize +endif + +cdata.set('BLCKSZ', blocksize, description: '''Size of a disk block --- this also limits the size of a tuple. You can set it bigger if you need bigger tuples (although TOAST should reduce the need to have large tuples, since fields can be spread across multiple tuples). @@ -429,7 +441,7 @@ cdata.set('BLCKSZ', get_option('blocksize').to_int() * 1024, description: Changing BLCKSZ requires an initdb.''') cdata.set('XLOG_BLCKSZ', get_option('wal_blocksize').to_int() * 1024) -cdata.set('RELSEG_SIZE', get_option('segsize') * 131072) +cdata.set('RELSEG_SIZE', segsize) cdata.set('DEF_PGPORT', get_option('pgport')) cdata.set_quoted('DEF_PGPORT_STR', get_option('pgport').to_string()) cdata.set_quoted('PG_KRB_SRVNAM', get_option('krb_srvnam')) @@ -3132,9 +3144,11 @@ if meson.version().version_compare('>=0.57') summary( { - 'data block size': cdata.get('BLCKSZ'), - 'WAL block size': cdata.get('XLOG_BLCKSZ') / 1024, - 'segment size': cdata.get('RELSEG_SIZE') / 131072, + 'data block size': '@0@ kB'.format(cdata.get('BLCKSZ') / 1024), + 'WAL block size': '@0@ kB'.format(cdata.get('XLOG_BLCKSZ') / 1024), + 'segment size': get_option('segsize_blocks') != 0 ? + '@0@ blocks'.format(cdata.get('RELSEG_SIZE')) : + '@0@ GB'.format(get_option('segsize')), }, section: 'Data layout', ) |
