pgsql: Ensure sufficient alignment for ParallelTableScanDescData inBTS - Mailing list pgsql-committers

From Andres Freund
Subject pgsql: Ensure sufficient alignment for ParallelTableScanDescData inBTS
Date
Msg-id E1h3SRz-0007eC-T7@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Ensure sufficient alignment for ParallelTableScanDescData in BTShared.

Previously ParallelTableScanDescData was just a member in BTShared,
but after c2fe139c2 that doesn't guarantee sufficient alignment as
specific AMs might (are likely to) need atomic variables in the
struct.

One might think that MAXALIGNing would be sufficient, but as a
comment in shm_toc_allocate() explains, that's not enough. For now,
copy the hack described there.

For parallel sequential scans no such change is needed, as its
allocations go through shm_toc_allocate().

An alternative approach would have been to allocate the parallel scan
descriptor in a separate TOC entry, but there seems little benefit in
doing so.

Per buildfarm member dromedary.

Author: Andres Freund
Discussion: https://postgr.es/m/20190311203126.ty5gbfz42gjbm6i6@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8cacea7a725103f1a037a5ee06112ebe31051c66

Modified Files
--------------
src/backend/access/nbtree/nbtsort.c | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)


pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: Re: pgsql: tableam: Add and use scan APIs.
Next
From: Tom Lane
Date:
Subject: pgsql: Give up on testing guc.c's behavior for "infinity" inputs.