Re: Immediate standby promotion - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Immediate standby promotion
Date
Msg-id CA+Tgmoa5JU_UU3v7T_aTvgLSvrOHFgUsqaVpUixMAG1MzJ5X5A@mail.gmail.com
Whole thread Raw
In response to Re: Immediate standby promotion  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Mon, Sep 1, 2014 at 7:14 AM, Fujii Masao <masao.fujii@gmail.com> wrote:
>> I think there is one downside as well for this proposal that
>> apart from data loss, it can lead to uncommitted data occupying
>> space in database which needs to be later cleaned by vacuum.
>> This can happen with non-immediate promote as well, but the
>> chances with immediate are more.  So the gain we got by doing
>> immediate promotion can lead to slow down of operations in some
>> cases.  It might be useful if we mention this in docs.
>
> Yep, the immediate promotion might be more likely to cause
> the recovery to end before replaying WAL data of VACUUM. But, OTOH,
> I think that the immediate promotion might be more likely to cause
> the recovery to end before replaying WAL data which will generate
> garbage data. So I'm not sure if it's worth adding that note to the doc.

-1 for documenting that.  This is mostly a general PostgreSQL
phenomenon and has little to do with immediate promotion specifically.
I think anything we write here is likely to be more confusing than
helpful.

> Agreed. So I'm thinking to change the code as follows.
>
> if (immediate_promote)
>         ereport(LOG, (errmsg("received immediate promote request")));
> else
>         ereport(LOG, (errmsg("received promote request")));

+1 for that version.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Next
From: Jeff Janes
Date:
Subject: Re: pgcrypto: PGP armor headers