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

Extra XLOG in Checkpoint for StandbySnapshot

From: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Extra XLOG in Checkpoint for StandbySnapshot
Date: 2013-01-07 12:39:19
Message-ID: 001801cdecd4$03f37080$0bda5180$@kapila@huawei.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Observation is that whenever a checkpoint happens and the wal_level
configured is hot_standby then one standby snapshot XLOG gets written with
the information of "running transaction". 


So if first time checkpoint happened at specified interval, it will create
new XLOG in LogStandbySnapshot, due to which checkpoint operation doesn't
get skipped again on next interval. This is okay if there are any running
transactions, but it seems XLOG is written even if there is no running xact.

As per the analysis below is the code snippet doing this: 
                running = GetRunningTransactionData(); 
                LogCurrentRunningXacts(running); 



So irrespective of value of running, snapshot is getting logged. 

So We can modify to change this in function LogStandbySnapshot as below: 
                running = GetRunningTransactionData(); 
                if (running->xcnt > 0) 
                        LogCurrentRunningXacts(running); 



So this check will make sure that if there is no operation happening i.e. no
new running transaction, then no need to log running transaction snapshot
and hence further checkpoint operations will be skipped. 



Let me know if I am missing something?

 

With Regards,

Amit Kapila.

pgsql-hackers by date

Next:From: Simon RiggsDate: 2013-01-07 13:00:03
Subject: Re: Extra XLOG in Checkpoint for StandbySnapshot
Previous:From: Peter EisentrautDate: 2013-01-07 12:14:58
Subject: psql \l to accept patterns

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