Catching resource leaks during WAL replay

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Catching resource leaks during WAL replay
Date: 2013-03-27 20:40:14
Message-ID: 5153592E.20102@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

While looking at bug #7969, it occurred to me that it would be nice if
we could catch resource leaks in WAL redo routines better. It would be
useful during development, to catch bugs earlier, and it could've turned
that replay-stopping error into a warning.

For regular transactions, we use ResourceOwners to track buffer pins
(like in #7969) and other resources. There's no fundamental reason we
couldn't use one during replay. After running a redo routine, there
should be no buffer pins held or other resources held.

Lwlocks are not tracked by resource owners, but we could still easily
warn if any are held after the redo routine exits.

- Heikki

Attachment Content-Type Size
xlog-redo-resource-leak-warning.patch text/x-diff 6.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2013-03-27 20:53:12 Re: pkg-config files for libpq and ecpg
Previous Message Peter Eisentraut 2013-03-27 20:35:00 Re: replace plugins directory with GUC