]> granicus.if.org Git - postgresql/commit
Retry DSM control segment creation if Windows indicates access denied.
authorRobert Haas <rhaas@postgresql.org>
Tue, 20 Sep 2016 16:04:41 +0000 (12:04 -0400)
committerRobert Haas <rhaas@postgresql.org>
Tue, 20 Sep 2016 16:12:31 +0000 (12:12 -0400)
commitc124e3649b0423cd7abc3f81208d9c7e8a7e8a8a
treecb571e975aa0dca3c4ef9676c9602931636b5a65
parentf0a86dfdb465d4d18b8010000205224733d9848e
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@mail.gmail.com>
src/backend/storage/ipc/dsm_impl.c