pgsql: Several changes to reduce the probability of running out of

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Several changes to reduce the probability of running out of
Date: 2006-11-23 01:14:59
Message-ID: 20061123011459.BD0FC9FB209@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2006-11-23 03:30:50 pgsql: Add release entry for 8.1.5 that was missing:
Previous Message User Diogob 2006-11-22 22:32:34 xlogviewer - xlogdump: corrected the -? logic