Skip site navigation (1) Skip section navigation (2)

Re: [BUG] Checkpointer on hot standby runs without looking checkpoint_segments

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: heikki(dot)linnakangas(at)enterprisedb(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [BUG] Checkpointer on hot standby runs without looking checkpoint_segments
Date: 2012-04-22 23:59:10
Message-ID: CAHGQGwFy4QFrBuMNk3VHM+X+PRtm_T3p-yzP2z8yNCH--QD4Uw@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, Apr 19, 2012 at 2:20 PM, Kyotaro HORIGUCHI
<horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> Hello, this is new version of standby checkpoint_segments patch.

Thanks for the patch!

>  - xlog.c: Make StandbyMode shared.
>
>  - checkpointer.c: Use IsStandbyMode() to check if postmaster is
>   under standby mode.

IsStandbyMode() looks overkill to me. The standby mode flag is forcibly
turned off at the end of recovery, but its change doesn't need to be shared
to the checkpointer process, IOW, the shared flag doesn't need to change
since startup like XLogCtl->archiveCleanupCommand, I think. So we can
simplify the code to share the flag to the checkpointer. See the attached
patch (though not tested yet).

The comments in checkpointer.c seems to need to be revised more. For
example,

+	 * XLogInsert that actually triggers a checkpoint when

Currently a checkpoint is triggered by XLogWrite (not XLogInsert), the above
needs to be corrected.

Regards,

-- 
Fujii Masao

Attachment: standby_checkpoint_segments_9.2dev_fix_20120423.patch
Description: application/octet-stream (6.4 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Jan UrbańskiDate: 2012-04-23 00:25:41
Subject: Re: plpython triggers are broken for composite-type columns
Previous:From: Jeff DavisDate: 2012-04-21 23:58:31
Subject: Re: 9.3: summary of corruption detection / checksums / CRCs discussion

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group