summaryrefslogtreecommitdiff
path: root/src/backend/storage/ipc/dsm.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2015-03-23 09:58:56 -0400
committerRobert Haas <rhaas@postgresql.org>2015-03-23 09:58:56 -0400
commit372b97097e8c9a67326e99a07da30ab44f6f822a (patch)
treea57e9bab5733705239c3a999cc6cc73debb27d09 /src/backend/storage/ipc/dsm.c
parent33a2c5ecd60a2cf68cfcdd37916f3989bb956581 (diff)
downloadpostgresql-372b97097e8c9a67326e99a07da30ab44f6f822a.tar.gz
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.
Diffstat (limited to 'src/backend/storage/ipc/dsm.c')
-rw-r--r--src/backend/storage/ipc/dsm.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/backend/storage/ipc/dsm.c b/src/backend/storage/ipc/dsm.c
index 96ca85e7d0..321bad9546 100644
--- a/src/backend/storage/ipc/dsm.c
+++ b/src/backend/storage/ipc/dsm.c
@@ -466,18 +466,6 @@ dsm_create(Size size, int flags)
if (!dsm_init_done)
dsm_backend_startup();
- /*
- * If we've been instructed to return NULL when it's not possible to
- * register another segment, check whether we seem to be at the limit.
- * This allows us to avoid the overhead of creating a new segment only to
- * immediately destroy it again. Since we don't take the lock here, the
- * value we read might be slightly stale, but the remote possibility of
- * an unnecessary failure here shouldn't trouble anyone too much.
- */
- if ((flags & DSM_CREATE_NULL_IF_MAXSEGMENTS) != 0
- && dsm_control->nitems >= dsm_control->maxitems)
- return NULL;
-
/* Create a new segment descriptor. */
seg = dsm_create_descriptor();