Re: [PATCH] Unremovable tuple monitoring

From: Royce Ausburn <royce(dot)ml(at)inomial(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Yeb Havinga <yebhavinga(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Kevin Grittner <kevin(dot)grittner(at)wicourts(dot)gov>
Subject: Re: [PATCH] Unremovable tuple monitoring
Date: 2011-11-16 03:02:05
Message-ID: 1D491D35-6D83-413C-8AB9-AE288F5D14B5@inomial.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 16/11/2011, at 12:26 PM, Robert Haas wrote:

> On Tue, Nov 15, 2011 at 7:59 PM, Royce Ausburn <royce(dot)ml(at)inomial(dot)com> wrote:
>>> Personally I think some log output, done better, would have been more useful for me at the time. At the time I was trying to diagnose an ineffective vacuum and postgres' logs weren't giving me any hints about what was wrong. I turned to the mailing list and got immediate help, but I felt that ideally postgres would be logging something to tell me that some 1 day old transactions were preventing auto vacuum from doing its job. Something, anything that I could google. Other novices in my situation probably wouldn't know to look in the pg_stats* tables, so in retrospect my patch isn't really achieving my original goal.
>>>
>>> Should we consider taking a logging approach instead?
>>
>> Dopey suggestion:
>>
>> Instead of logging around vacuum and auto_vacuum, perhaps log transactions that are open for longer than some (perhaps configurable) time? The default might be pretty large, say 6 hours. Are there common use cases for txs that run for longer than 6 hours? Seeing a message such as:
>>
>> WARNING: Transaction <X> has been open more than Y. This tx may be holding locks preventing other txs from operating and may prevent vacuum from cleaning up deleted rows.
>>
>> Would give a pretty clear indication of a problem :)
>
> Well, you could that much just by periodically querying pg_stat_activity.

Fair enough -- someone knowledgable could set that up if they wanted. My goal was mostly to have something helpful in the logs. If that's not something postgres wants/needs Ill drop it =)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2011-11-16 03:09:19 Re: Core Extensions relocation
Previous Message Peter Geoghegan 2011-11-16 01:49:17 Re: ISN was: Core Extensions relocation