pgsql: Retry DSM control segment creation if Windows indicates access d

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Retry DSM control segment creation if Windows indicates access d
Date: 2016-09-20 16:14:36
Message-ID: E1bmNgq-00075W-RK@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Retry DSM control segment creation if Windows indicates access denied.

Otherwise, attempts to run multiple postmasters running on the same
machine may fail, because Windows sometimes returns ERROR_ACCESS_DENIED
rather than ERROR_ALREADY_EXISTS when there is an existing segment.

Hitting this bug is much more likely because of another defect not
fixed by this patch, namely that dsm_postmaster_startup() uses
random() which returns the same value every time. But that's not
a reason not to fix this.

Kyotaro Horiguchi and Amit Kapila, reviewed by Michael Paquier

Discussion: <CAA4eK1JyNdMeF-dgrpHozDecpDfsRZUtpCi+1AbtuEkfG3YooQ(at)mail(dot)gmail(dot)com>

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/c23b2523d3fcc09524e6720d7c2558ba1ee6c239

Modified Files
--------------
src/backend/storage/ipc/dsm_impl.c | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2016-09-20 16:32:54 pgsql: Use PostmasterRandom(), not random(), for DSM control segment ID
Previous Message Heikki Linnakangas 2016-09-20 08:41:24 pgsql: Fix outdated comments, GIST search queue is not an RBTree anymor