Re: pg_subtrans keeps bloating up in the standby

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, "Kolb, Harald (NSN - DE/Munich)" <harald(dot)kolb(at)nsn(dot)com>
Subject: Re: pg_subtrans keeps bloating up in the standby
Date: 2010-08-27 14:25:58
Message-ID: 4C77CAF6.5030403@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 27/08/10 16:39, Fujii Masao wrote:
> I received the off-list email reporting that pg_subtrans keeps bloating up
> in the standby, from Harald (Thanks!). I investigated this issue and found
> that the standby doesn't truncate pg_subtrans at all even though HS keeps
> extending it. In the master, a checkpoint calls TruncateSUBTRANS() and
> truncate old pg_subtrans entries, but in the standby, a restartpoint doesn't
> do that. And I found the following comment in CreateRestartPoint():
>
> /*
> * Currently, there is no need to truncate pg_subtrans during recovery. If
> * we did do that, we will need to have called StartupSUBTRANS() already
> * and then TruncateSUBTRANS() would go here.
> */
>
> I'm not sure why there is no need to truncate pg_subtrans during recovery.
> To fix the issue, we should make a restartpoint call TruncateSUBTRANS().
> Thought?

Hmm, agreed, seems like an oversight in hot standby. Before that, we
didn't update pg_subtrans during recovery, so there was no point
truncating it. But in hot standby, we do update it, so we need to
truncate it too.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2010-08-27 15:54:51 Re: pg_subtrans keeps bloating up in the standby
Previous Message Fujii Masao 2010-08-27 13:39:21 pg_subtrans keeps bloating up in the standby