Re: [9.3 bug] disk space in pg_xlog increases during archive recovery

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: MauMau <maumau307(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [9.3 bug] disk space in pg_xlog increases during archive recovery
Date: 2013-07-31 14:31:38
Message-ID: CAHGQGwEUGpTL6jNObjXTKp_JvBgF0DGSC4v9Wy+eymfh2Fmo5Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 31, 2013 at 10:43 PM, MauMau <maumau307(at)gmail(dot)com> wrote:
> Hello, Fujii san, all,
>
> From: "Fujii Masao" <masao(dot)fujii(at)gmail(dot)com>
>>
>> On Sun, Jul 28, 2013 at 7:59 AM, MauMau <maumau307(at)gmail(dot)com> wrote:
>> Do you think this should be fixed?
>>
>> I think so.
>>
>>> How should it be fixed?
>>
>>
>> What about removing the restored archived file as soon as it's replayed
>> if cascading replication is not enabled (i.e., max_wal_senders = 0 or
>> hot_standby = off)? This doesn't seem to break the existing behavior
>> in 9.2.
>
>
> Please find attached the patch to fix the problem. I changed to keep
> restored WAL files in pg_xlog/ only on a cascading standby server. Could
> you review and commit this?

- if (source == XLOG_FROM_ARCHIVE)
+ if (source == XLOG_FROM_ARCHIVE &&
+ StandbyModeRequested && AllowCascadeReplication())

I think that the condition of StandbyModeRequested should be removed
because someone might want to set up the cascade standby from the standby
of warm-standby configuration.

> BTW, KeepFileRestoredFromArchive() is also called to keep timeline history
> files in pg_xlog/. What is this for? Is this necessary for recovery other
> than cascading standbys?

Yes. Please see 60df192aea0e6458f20301546e11f7673c102101

> This seems to accumulate timeline history files
> forever in pg_xlog/.

Yes, because basically there is no way to delete the timeline history files
from pg_xlog.

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2013-07-31 15:37:27 Re: (trivial patch) remove superfluous semicolons from pg_dump
Previous Message Tom Lane 2013-07-31 14:17:00 Re: REGEXP_MATCHES() strange behavior with '^' and '$' pattern