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

Checkpointer on hot standby runs without looking checkpoint_segments

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Cc: heikki(dot)linnakangas(at)enterprisedb(dot)com, masao(dot)fujii(at)gmail(dot)com
Subject: Checkpointer on hot standby runs without looking checkpoint_segments
Date: 2012-06-08 08:14:48
Message-ID: 20120608.171448.141651827.horiguchi.kyotaro@lab.ntt.co.jp (view raw or flat)
Thread:
Lists: pgsql-hackers
Hello, I will make this patch start again for this CF.

The requirement for this patch is as follows.

- What I want to get is similarity of the behaviors between
  master and (hot-)standby concerning checkpoint
  progression. Specifically, checkpoints for streaming
  replication running at the speed governed with
  checkpoint_segments. The work of this patch is avoiding to get
  unexpectedly large number of WAL segments stay on standby
  side. (Plus, increasing the chance to skip recovery-end
  checkpoint by my another patch.)

- This patch shouldn't affect archive recovery (excluding
  streaming). Activity of the checkpoints while recoverying from
  WAL archive (Precisely, while archive recovery without WAL
  receiver launched.) is depressed to checkpoint_timeout level as
  before.

- It might be better if the accelaration can be inhibited. But
  this patch does not have the feature. Is it needed?


After the consideration of the past discussion and the another
patch I'm going to put on the table, outline of this patch
becomes as follows.

- Check if it is under streaming replication by new function
  WalRcvStarted() which tells whether wal receiver has been
  launched so far.

  - The implement of WalRcvStarted() is changed from previous
    one. Now the state is turned on in WalReceiverMain, at the
    point where the state of walRcvState becomes
    WALRCV_RUNNING. The behavior of previous implement reading
    WalRcvInProgress() was useless for my another patch.

- Determine whether to delay checkpoint by GetLogReplayRecPtr()
  instead of GetInsertRecPtr() when WalRcvStarted() says true.

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center

== My e-mail address has been changed since Apr. 1, 2012.

Attachment: chkpt_segs_for_standby_20120608_1.patch
Description: text/x-patch (4.6 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Kyotaro HORIGUCHIDate: 2012-06-08 08:22:01
Subject: Skip checkpoint on promoting from streaming replication
Previous:From: Andres FreundDate: 2012-06-08 08:11:51
Subject: Re: New Postgres committer: Kevin Grittner

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