[COMMITTERS] pgsql: Code review for shm_toc.h/.c. - Mailing list pgsql-committers

From Tom Lane
Subject [COMMITTERS] pgsql: Code review for shm_toc.h/.c.
Date
Msg-id E1dHx5q-0004cv-MK@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Code review for shm_toc.h/.c.

Declare the toc_nentry field as uint32 not Size.  Since shm_toc_lookup()
reads the field without any lock, it has to be atomically readable, and
we do not assume that for fields wider than 32 bits.  Performance would
be impossibly bad for entry counts approaching 2^32 anyway, so there is
no need to try to preserve maximum width here.

This is probably an academic issue, because even if reading int64 isn't
atomic, the high order half would never change in practice.  Still, it's
a coding rule violation, so let's fix it.

Adjust some other not-terribly-well-chosen data types too, and copy-edit
some comments.  Make shm_toc_attach's Asserts consistent with
shm_toc_create's.

None of this looks to be a live bug, so no need for back-patch.

Discussion: https://postgr.es/m/16984.1496679541@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3e60c6f72328a9ad14d8a087411cd394752c5b23

Modified Files
--------------
src/backend/storage/ipc/shm_toc.c | 40 +++++++++++++++++++++------------------
src/include/storage/shm_toc.h     | 15 ++++++++-------
2 files changed, 30 insertions(+), 25 deletions(-)


pgsql-committers by date:

Previous
From: Andrew Dunstan
Date:
Subject: [COMMITTERS] pgsql: Find openssl lib files in right directory for MSVC
Next
From: Andres Freund
Date:
Subject: [COMMITTERS] pgsql: Fix record length computation in pg_waldump/xlogdump.