pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: On Windows, ensure shared memory handle gets closed if not being
6+ messages / 1 participants
[nested] [flat]

* pgsql: On Windows, ensure shared memory handle gets closed if not being
@ 2015-10-13 15:21  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-10-13 15:21 UTC (permalink / raw)
  To: pgsql-committers

On Windows, ensure shared memory handle gets closed if not being used.

Postmaster child processes that aren't supposed to be attached to shared
memory were not bothering to close the shared memory mapping handle they
inherit from the postmaster process.  That's mostly harmless, since the
handle vanishes anyway when the child process exits -- but the syslogger
process, if used, doesn't get killed and restarted during recovery from a
backend crash.  That meant that Windows doesn't see the shared memory
mapping as becoming free, so it doesn't delete it and the postmaster is
unable to create a new one, resulting in failure to recover from crashes
whenever logging_collector is turned on.

Per report from Dmitry Vasilyev.  It's a bit astonishing that we'd not
figured this out long ago, since it's been broken from the very beginnings
of out native Windows support; probably some previously-unexplained trouble
reports trace to this.

A secondary problem is that on Cygwin (perhaps only in older versions?),
exec() may not detach from the shared memory segment after all, in which
case these child processes did remain attached to shared memory, posing
the risk of an unexpected shared memory clobber if they went off the rails
somehow.  That may be a long-gone bug, but we can deal with it now if it's
still live, by detaching within the infrastructure introduced here to deal
with closing the handle.

Back-patch to all supported branches.

Tom Lane and Amit Kapila

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/44a6e24fbc8b2ec5fec4be6850b2e816864e2cca

Modified Files
--------------
src/backend/port/sysv_shmem.c       |   53 ++++++++++++++++++----
src/backend/port/win32_shmem.c      |   82 ++++++++++++++++++++++++++++-------
src/backend/postmaster/postmaster.c |    5 ++-
src/include/storage/pg_shmem.h      |    1 +
4 files changed, 116 insertions(+), 25 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: On Windows, ensure shared memory handle gets closed if not being
@ 2015-10-13 15:21  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-10-13 15:21 UTC (permalink / raw)
  To: pgsql-committers

On Windows, ensure shared memory handle gets closed if not being used.

Postmaster child processes that aren't supposed to be attached to shared
memory were not bothering to close the shared memory mapping handle they
inherit from the postmaster process.  That's mostly harmless, since the
handle vanishes anyway when the child process exits -- but the syslogger
process, if used, doesn't get killed and restarted during recovery from a
backend crash.  That meant that Windows doesn't see the shared memory
mapping as becoming free, so it doesn't delete it and the postmaster is
unable to create a new one, resulting in failure to recover from crashes
whenever logging_collector is turned on.

Per report from Dmitry Vasilyev.  It's a bit astonishing that we'd not
figured this out long ago, since it's been broken from the very beginnings
of out native Windows support; probably some previously-unexplained trouble
reports trace to this.

A secondary problem is that on Cygwin (perhaps only in older versions?),
exec() may not detach from the shared memory segment after all, in which
case these child processes did remain attached to shared memory, posing
the risk of an unexpected shared memory clobber if they went off the rails
somehow.  That may be a long-gone bug, but we can deal with it now if it's
still live, by detaching within the infrastructure introduced here to deal
with closing the handle.

Back-patch to all supported branches.

Tom Lane and Amit Kapila

Branch
------
REL9_3_STABLE

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

Modified Files
--------------
src/backend/port/sysv_shmem.c       |   53 ++++++++++++++++++----
src/backend/port/win32_shmem.c      |   82 ++++++++++++++++++++++++++++-------
src/backend/postmaster/postmaster.c |    5 ++-
src/include/storage/pg_shmem.h      |    1 +
4 files changed, 116 insertions(+), 25 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: On Windows, ensure shared memory handle gets closed if not being
@ 2015-10-13 15:21  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-10-13 15:21 UTC (permalink / raw)
  To: pgsql-committers

On Windows, ensure shared memory handle gets closed if not being used.

Postmaster child processes that aren't supposed to be attached to shared
memory were not bothering to close the shared memory mapping handle they
inherit from the postmaster process.  That's mostly harmless, since the
handle vanishes anyway when the child process exits -- but the syslogger
process, if used, doesn't get killed and restarted during recovery from a
backend crash.  That meant that Windows doesn't see the shared memory
mapping as becoming free, so it doesn't delete it and the postmaster is
unable to create a new one, resulting in failure to recover from crashes
whenever logging_collector is turned on.

Per report from Dmitry Vasilyev.  It's a bit astonishing that we'd not
figured this out long ago, since it's been broken from the very beginnings
of out native Windows support; probably some previously-unexplained trouble
reports trace to this.

A secondary problem is that on Cygwin (perhaps only in older versions?),
exec() may not detach from the shared memory segment after all, in which
case these child processes did remain attached to shared memory, posing
the risk of an unexpected shared memory clobber if they went off the rails
somehow.  That may be a long-gone bug, but we can deal with it now if it's
still live, by detaching within the infrastructure introduced here to deal
with closing the handle.

Back-patch to all supported branches.

Tom Lane and Amit Kapila

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/39cd1bdb8655fc897e8cb77613c21acb677709d7

Modified Files
--------------
src/backend/port/sysv_shmem.c       |   53 ++++++++++++++++++----
src/backend/port/win32_shmem.c      |   82 ++++++++++++++++++++++++++++-------
src/backend/postmaster/postmaster.c |    5 ++-
src/include/storage/pg_shmem.h      |    1 +
4 files changed, 116 insertions(+), 25 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: On Windows, ensure shared memory handle gets closed if not being
@ 2015-10-13 15:21  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-10-13 15:21 UTC (permalink / raw)
  To: pgsql-committers

On Windows, ensure shared memory handle gets closed if not being used.

Postmaster child processes that aren't supposed to be attached to shared
memory were not bothering to close the shared memory mapping handle they
inherit from the postmaster process.  That's mostly harmless, since the
handle vanishes anyway when the child process exits -- but the syslogger
process, if used, doesn't get killed and restarted during recovery from a
backend crash.  That meant that Windows doesn't see the shared memory
mapping as becoming free, so it doesn't delete it and the postmaster is
unable to create a new one, resulting in failure to recover from crashes
whenever logging_collector is turned on.

Per report from Dmitry Vasilyev.  It's a bit astonishing that we'd not
figured this out long ago, since it's been broken from the very beginnings
of out native Windows support; probably some previously-unexplained trouble
reports trace to this.

A secondary problem is that on Cygwin (perhaps only in older versions?),
exec() may not detach from the shared memory segment after all, in which
case these child processes did remain attached to shared memory, posing
the risk of an unexpected shared memory clobber if they went off the rails
somehow.  That may be a long-gone bug, but we can deal with it now if it's
still live, by detaching within the infrastructure introduced here to deal
with closing the handle.

Back-patch to all supported branches.

Tom Lane and Amit Kapila

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/39ac293940ec022f36510ba72470f23799e21dde

Modified Files
--------------
src/backend/port/sysv_shmem.c       |   53 ++++++++++++++++++----
src/backend/port/win32_shmem.c      |   82 ++++++++++++++++++++++++++++-------
src/backend/postmaster/postmaster.c |    5 ++-
src/include/storage/pg_shmem.h      |    1 +
4 files changed, 116 insertions(+), 25 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: On Windows, ensure shared memory handle gets closed if not being
@ 2015-10-13 15:21  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-10-13 15:21 UTC (permalink / raw)
  To: pgsql-committers

On Windows, ensure shared memory handle gets closed if not being used.

Postmaster child processes that aren't supposed to be attached to shared
memory were not bothering to close the shared memory mapping handle they
inherit from the postmaster process.  That's mostly harmless, since the
handle vanishes anyway when the child process exits -- but the syslogger
process, if used, doesn't get killed and restarted during recovery from a
backend crash.  That meant that Windows doesn't see the shared memory
mapping as becoming free, so it doesn't delete it and the postmaster is
unable to create a new one, resulting in failure to recover from crashes
whenever logging_collector is turned on.

Per report from Dmitry Vasilyev.  It's a bit astonishing that we'd not
figured this out long ago, since it's been broken from the very beginnings
of out native Windows support; probably some previously-unexplained trouble
reports trace to this.

A secondary problem is that on Cygwin (perhaps only in older versions?),
exec() may not detach from the shared memory segment after all, in which
case these child processes did remain attached to shared memory, posing
the risk of an unexpected shared memory clobber if they went off the rails
somehow.  That may be a long-gone bug, but we can deal with it now if it's
still live, by detaching within the infrastructure introduced here to deal
with closing the handle.

Back-patch to all supported branches.

Tom Lane and Amit Kapila

Branch
------
REL9_1_STABLE

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

Modified Files
--------------
src/backend/port/sysv_shmem.c       |   53 ++++++++++++++++++----
src/backend/port/win32_shmem.c      |   82 ++++++++++++++++++++++++++++-------
src/backend/postmaster/postmaster.c |    5 ++-
src/include/storage/pg_shmem.h      |    1 +
4 files changed, 116 insertions(+), 25 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: On Windows, ensure shared memory handle gets closed if not being
@ 2015-10-13 15:21  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-10-13 15:21 UTC (permalink / raw)
  To: pgsql-committers

On Windows, ensure shared memory handle gets closed if not being used.

Postmaster child processes that aren't supposed to be attached to shared
memory were not bothering to close the shared memory mapping handle they
inherit from the postmaster process.  That's mostly harmless, since the
handle vanishes anyway when the child process exits -- but the syslogger
process, if used, doesn't get killed and restarted during recovery from a
backend crash.  That meant that Windows doesn't see the shared memory
mapping as becoming free, so it doesn't delete it and the postmaster is
unable to create a new one, resulting in failure to recover from crashes
whenever logging_collector is turned on.

Per report from Dmitry Vasilyev.  It's a bit astonishing that we'd not
figured this out long ago, since it's been broken from the very beginnings
of out native Windows support; probably some previously-unexplained trouble
reports trace to this.

A secondary problem is that on Cygwin (perhaps only in older versions?),
exec() may not detach from the shared memory segment after all, in which
case these child processes did remain attached to shared memory, posing
the risk of an unexpected shared memory clobber if they went off the rails
somehow.  That may be a long-gone bug, but we can deal with it now if it's
still live, by detaching within the infrastructure introduced here to deal
with closing the handle.

Back-patch to all supported branches.

Tom Lane and Amit Kapila

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/869f693a36556e9872c4369820ce8289451619f0

Modified Files
--------------
src/backend/port/sysv_shmem.c       |   53 ++++++++++++++++++----
src/backend/port/win32_shmem.c      |   82 ++++++++++++++++++++++++++++-------
src/backend/postmaster/postmaster.c |    5 ++-
src/include/storage/pg_shmem.h      |    1 +
4 files changed, 116 insertions(+), 25 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2015-10-13 15:21 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-10-13 15:21 pgsql: On Windows, ensure shared memory handle gets closed if not being Tom Lane <tgl@sss.pgh.pa.us>
2015-10-13 15:21 pgsql: On Windows, ensure shared memory handle gets closed if not being Tom Lane <tgl@sss.pgh.pa.us>
2015-10-13 15:21 pgsql: On Windows, ensure shared memory handle gets closed if not being Tom Lane <tgl@sss.pgh.pa.us>
2015-10-13 15:21 pgsql: On Windows, ensure shared memory handle gets closed if not being Tom Lane <tgl@sss.pgh.pa.us>
2015-10-13 15:21 pgsql: On Windows, ensure shared memory handle gets closed if not being Tom Lane <tgl@sss.pgh.pa.us>
2015-10-13 15:21 pgsql: On Windows, ensure shared memory handle gets closed if not being Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox