Skip checkpoint on promoting from streaming replication
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
From: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
To: pgsql-hackers@postgresql.org
Date: 2012-06-08T08:22:01Z
Lists: pgsql-hackers
Attachments
- skip_ckpt_after_rcv_on_stby_20120608_1.patch (text/x-patch) patch
Hello, I have a problem with promoting from hot-standby that exclusive checkpointing retards completion of promotion. This checkpoint is "shutdown checkpoint" as a convention in realtion to TLI increment according to the comment shown below. I suppose "shutdown checkpoint" means exclusive checkpoint - in other words, checkpoint without WAL inserts meanwhile. > * one. This is not particularly critical, but since we may be > * assigning a new TLI, using a shutdown checkpoint allows us to have > * the rule that TLI only changes in shutdown checkpoints, which > * allows some extra error checking in xlog_redo. I depend on this and suppose we can omit it if latest checkpoint has been taken so as to be able to do crash recovery thereafter. This condition could be secured by my another patch for checkpoint_segments on standby. After applying this patch, checkpoint after archive recovery at near the end of StartupXLOG() will be skiped on the condition follows, - WAL receiver has been launched so far. (using WalRcvStarted()) - XLogCheckpointNeeded() against replayEndRecPtr says no need of checkpoint. What do you think about this? This patch needs WalRcvStarted() introduced by my another patch. http://archives.postgresql.org/pgsql-hackers/2012-06/msg00287.php regards, -- Kyotaro Horiguchi NTT Open Source Software Center == My e-mail address has been changed since Apr. 1, 2012.