pgsql: Several changes to reduce the probability of running out of - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Several changes to reduce the probability of running out of
Date
Msg-id 20061123011459.BD0FC9FB209@postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Several changes to reduce the probability of running out of memory during
AbortTransaction, which would lead to recursion and eventual PANIC exit
as illustrated in recent report from Jeff Davis.  First, in xact.c create
a special dedicated memory context for AbortTransaction to run in.  This
solves the problem as long as AbortTransaction doesn't need more than 32K
(or whatever other size we create the context with).  But in corner cases
it might.  Second, in trigger.c arrange to keep pending after-trigger event
records in separate contexts that can be freed near the beginning of
AbortTransaction, rather than having them persist until CleanupTransaction
as before.  Third, in portalmem.c arrange to free executor state data
earlier as well.  These two changes should result in backing off the
out-of-memory condition before AbortTransaction needs any significant
amount of memory, at least in typical cases such as memory overrun due
to too many trigger events or too big an executor hash table.  And all
the same for subtransaction abort too, of course.

Modified Files:
--------------
    pgsql/src/backend/access/transam:
        xact.c (r1.228 -> r1.229)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xact.c.diff?r1=1.228&r2=1.229)
    pgsql/src/backend/commands:
        trigger.c (r1.209 -> r1.210)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/trigger.c.diff?r1=1.209&r2=1.210)
    pgsql/src/backend/utils/mmgr:
        portalmem.c (r1.96 -> r1.97)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mmgr/portalmem.c.diff?r1=1.96&r2=1.97)

pgsql-committers by date:

Previous
From: diogob@pgfoundry.org (User Diogob)
Date:
Subject: xlogviewer - xlogdump: corrected the -? logic
Next
From: momjian@postgresql.org (Bruce Momjian)
Date:
Subject: pgsql: Add release entry for 8.1.5 that was missing: