pgsql: Ensure sufficient alignment for ParallelTableScanDescData in BTS

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Ensure sufficient alignment for ParallelTableScanDescData in BTS
Date: 2019-03-11 21:27:11
Message-ID: E1h3SRz-0007eC-T7@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-03-11 21:53:18 pgsql: Give up on testing guc.c's behavior for "infinity" inputs.
Previous Message Andres Freund 2019-03-11 20:32:42 Re: pgsql: tableam: Add and use scan APIs.