pgsql: Teach DSM registry to ERROR if attaching to an uninitialized ent
Nathan Bossart <nathan@postgresql.org>
From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Date: 2025-11-12T20:31:10Z
Lists: pgsql-hackers
Teach DSM registry to ERROR if attaching to an uninitialized entry. If DSM entry initialization fails, backends could try to use an uninitialized DSM segment, DSA, or dshash table (since the entry is still added to the registry). To fix, keep track of whether initialization completed, and ERROR if a backend tries to attach to an uninitialized entry. We could instead retry initialization as needed, but that seemed complicated, error prone, and unlikely to help most cases. Furthermore, such problems probably indicate a coding error. Reported-by: Alexander Lakhin <exclusion@gmail.com> Reviewed-by: Sami Imseih <samimseih@gmail.com> Discussion: https://postgr.es/m/dd36d384-55df-4fc2-825c-5bc56c950fa9%40gmail.com Backpatch-through: 17 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/1165a933aab1355757a43cfd9193b6cce06f573b Modified Files -------------- src/backend/storage/ipc/dsm_registry.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-)
Commits
-
Teach DSM registry to retry entry initialization if needed.
- dbdc717ac674 19 (unreleased) landed
- b83bcc0df180 18.2 landed
- 2fc5c5062207 17.8 landed
-
Revert "Teach DSM registry to ERROR if attaching to an uninitialized entry."
- c7e0f263d67f 17.8 landed
- 8551a289201c 18.2 landed
- 2dd506b859cf 19 (unreleased) landed
-
Teach DSM registry to ERROR if attaching to an uninitialized entry.
- 1165a933aab1 19 (unreleased) cited