Re: V4 of PITR performance improvement for 8.4

From: Koichi Suzuki <koichi(dot)szk(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Gregory Stark <stark(at)enterprisedb(dot)com>, ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: V4 of PITR performance improvement for 8.4
Date: 2009-03-16 05:55:03
Message-ID: a778a7260903152255n783c4eb6kd6bba92a42bcca84@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This is a patch with error handling of malloc().

I found that skipping readahead at malloc() error leads to too many
changes with very little to get. The memory area are kept only
during the recovery and is released at the end of the recovery.

So shortage of this memory area will easily lead to another memory
problem anyway.

2009/3/11 Koichi Suzuki <koichi(dot)szk(at)gmail(dot)com>:
> Hi,
>
> 2009/3/10 Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>:
>> Fujii Masao wrote:
>>>
>>> Hi,
>>>
>>> On Mon, Mar 9, 2009 at 10:20 PM, Heikki Linnakangas
>>> <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>>>>
>>>> Thanks. This patch seems to be missing the new readahead.c file. I
>>>> grabbed
>>>> that from the previous patch version.
>>>
>>> Oh, sorry for the mistake. I changed one of Suzuki-san's patches
>>> to be rebased to HEAD again (readahead-20090310.patch).
>>> The other (addShBufCheck-20090120.patch) is not changed.
>>>
>>> Comment:
>>> we might reach consistent recovery state *before* redoing the safe
>>> starting point, because readahead slightly delays the actual redo.
>>> Is this safe?
>>
>> No. If you haven't replayed all the WAL records up to the safe starting
>> point, the database isn't consistent yet. The distinction doesn't matter in
>> practice without Hot Standby, though.
>>
>>> If not, the readahead queue should be flushed before
>>> reaching that state?
>>
>> Yes. Or you could move the reporting that you've reached the consistent
>> recovery state into RedoRecords, when you reach the min safe starting point.
>
> This arrangement can be done with Hot Standby and Sync.Rep, right?
>
> So far, it sounds that we need to add a code to handle if malloc()
> fails (OOM).   In this case, possible way could be to skip whole
> readahead, although the rest of the recovery may fail because of the
> memory shortage.
>
>>
>> --
>>  Heikki Linnakangas
>>  EnterpriseDB   http://www.enterprisedb.com
>>
>
>
>
> --
> ------
> Koichi Suzuki
>

--
------
Koichi Suzuki

Attachment Content-Type Size
readahead-20090316.patch text/plain 517.6 KB
addShBufCheck-20090120.patch text/plain 6.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ron Mayer 2009-03-16 06:30:07 Re: hstore improvements?
Previous Message KaiGai Kohei 2009-03-16 05:05:47 Re: Updates of SE-PostgreSQL 8.4devel patches (r1710)