Skip to content

Commit 372b970

Browse files
committed
Remove ill-advised pre-check for DSM segment exhaustion.
dsm_control->nitems never decreases, so this is testing whether the server has *ever* run out of DSM segments, not whether it is *currently* out of DSM segments. Reported off-list by Amit Kapila.
1 parent 33a2c5e commit 372b970

File tree

1 file changed

+0
-12
lines changed
  • src/backend/storage/ipc

1 file changed

+0
-12
lines changed

src/backend/storage/ipc/dsm.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -466,18 +466,6 @@ dsm_create(Size size, int flags)
466466
if (!dsm_init_done)
467467
dsm_backend_startup();
468468

469-
/*
470-
* If we've been instructed to return NULL when it's not possible to
471-
* register another segment, check whether we seem to be at the limit.
472-
* This allows us to avoid the overhead of creating a new segment only to
473-
* immediately destroy it again. Since we don't take the lock here, the
474-
* value we read might be slightly stale, but the remote possibility of
475-
* an unnecessary failure here shouldn't trouble anyone too much.
476-
*/
477-
if ((flags & DSM_CREATE_NULL_IF_MAXSEGMENTS) != 0
478-
&& dsm_control->nitems >= dsm_control->maxitems)
479-
return NULL;
480-
481469
/* Create a new segment descriptor. */
482470
seg = dsm_create_descriptor();
483471

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy