pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix error cleanup failure caused by 8.4 changes in plpgsql to try
3+ messages / 2 participants
[nested] [flat]

* pgsql: Fix error cleanup failure caused by 8.4 changes in plpgsql to try
@ 2009-07-18 19:15 Tom Lane <tgl@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: tgl@postgresql.org @ 2009-07-18 19:15 UTC (permalink / raw)
  To: pgsql-committers

Log Message:
-----------
Fix error cleanup failure caused by 8.4 changes in plpgsql to try to avoid
memory leakage in error recovery.  We were calling FreeExprContext, and
therefore invoking ExprContextCallback callbacks, in both normal and error
exits from subtransactions.  However this isn't very safe, as shown in
recent trouble report from Frank van Vugt, in which releasing a tupledesc
refcount failed.  It's also unnecessary, since the resources that callbacks
might wish to release should be cleaned up by other error recovery mechanisms
(ie the resource owners).  We only really want FreeExprContext to release
memory attached to the exprcontext in the error-exit case.  So, add a bool
parameter to FreeExprContext to tell it not to call the callbacks.

A more general solution would be to pass the isCommit bool parameter on to
the callbacks, so they could do only safe things during error exit.  But
that would make the patch significantly more invasive and possibly break
third-party code that registers ExprContextCallback callbacks.  We might want
to do that later in HEAD, but for now I'll just do what seems reasonable to
back-patch.

Modified Files:
--------------
    pgsql/src/backend/executor:
        execUtils.c (r1.159 -> r1.160)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execUtils.c?r1=1.159&r2=1.16...)
        nodeBitmapIndexscan.c (r1.30 -> r1.31)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeBitmapIndexscan.c?r1=1.30&am...)
        nodeIndexscan.c (r1.132 -> r1.133)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeIndexscan.c?r1=1.132&r2=...)
    pgsql/src/include/executor:
        executor.h (r1.155 -> r1.156)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/executor.h?r1=1.155&r2=1.156)
    pgsql/src/pl/plpgsql/src:
        pl_exec.c (r1.244 -> r1.245)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_exec.c?r1=1.244&r2=1.245)




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

* pgsql: Fix error cleanup failure caused by 8.4 changes in plpgsql to try
@ 2009-07-18 19:15 Tom Lane <tgl@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: tgl@postgresql.org @ 2009-07-18 19:15 UTC (permalink / raw)
  To: pgsql-committers

Log Message:
-----------
Fix error cleanup failure caused by 8.4 changes in plpgsql to try to avoid
memory leakage in error recovery.  We were calling FreeExprContext, and
therefore invoking ExprContextCallback callbacks, in both normal and error
exits from subtransactions.  However this isn't very safe, as shown in
recent trouble report from Frank van Vugt, in which releasing a tupledesc
refcount failed.  It's also unnecessary, since the resources that callbacks
might wish to release should be cleaned up by other error recovery mechanisms
(ie the resource owners).  We only really want FreeExprContext to release
memory attached to the exprcontext in the error-exit case.  So, add a bool
parameter to FreeExprContext to tell it not to call the callbacks.

A more general solution would be to pass the isCommit bool parameter on to
the callbacks, so they could do only safe things during error exit.  But
that would make the patch significantly more invasive and possibly break
third-party code that registers ExprContextCallback callbacks.  We might want
to do that later in HEAD, but for now I'll just do what seems reasonable to
back-patch.

Tags:
----
REL8_4_STABLE

Modified Files:
--------------
    pgsql/src/backend/executor:
        execUtils.c (r1.159 -> r1.159.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execUtils.c?r1=1.159&r2=1.15...)
        nodeBitmapIndexscan.c (r1.30 -> r1.30.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeBitmapIndexscan.c?r1=1.30&am...)
        nodeIndexscan.c (r1.132 -> r1.132.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeIndexscan.c?r1=1.132&r2=...)
    pgsql/src/include/executor:
        executor.h (r1.155 -> r1.155.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/executor.h?r1=1.155&r2=1.155...)
    pgsql/src/pl/plpgsql/src:
        pl_exec.c (r1.244 -> r1.244.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_exec.c?r1=1.244&r2=1.244.2....)




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

* pgsql: Move some functions from postmaster.c to a new source file
@ 2024-03-18 09:40 Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 3+ messages in thread

From: Heikki Linnakangas @ 2024-03-18 09:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Move some functions from postmaster.c to a new source file

This just moves the functions, with no other changes, to make the next
commits smaller and easier to review. The moved functions are related
to launching postmaster child processes in EXEC_BACKEND mode.

Reviewed-by: Tristan Partin, Andres Freund
Discussion: https://www.postgresql.org/message-id/7a59b073-5b5b-151e-7ed3-8b01ff7ce9ef@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f1baed18bc3db50c72bfb00b6247b47689158445

Modified Files
--------------
src/backend/postmaster/Makefile         |   1 +
src/backend/postmaster/launch_backend.c | 811 ++++++++++++++++++++++++++++++++
src/backend/postmaster/meson.build      |   1 +
src/backend/postmaster/postmaster.c     | 752 +----------------------------
src/include/postmaster/postmaster.h     |   5 +
5 files changed, 828 insertions(+), 742 deletions(-)



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


end of thread, other threads:[~2024-03-18 09:40 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-07-18 19:15 pgsql: Fix error cleanup failure caused by 8.4 changes in plpgsql to try Tom Lane <tgl@postgresql.org>
2009-07-18 19:15 pgsql: Fix error cleanup failure caused by 8.4 changes in plpgsql to try Tom Lane <tgl@postgresql.org>
2024-03-18 09:40 pgsql: Move some functions from postmaster.c to a new source file Heikki Linnakangas <heikki.linnakangas@iki.fi>

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