Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby
Date
Msg-id CAB7nPqS-joTOdjqBUYGdawVcOw5UwrMZf+vOdzzbgHtDBg6SRg@mail.gmail.com
Whole thread Raw
In response to Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-bugs
On Tue, Oct 20, 2015 at 2:21 AM, Michael Paquier wrote:
> On Sat, Oct 17, 2015 at 11:10 PM, Michael Paquier wrote:
>> I think that a simple idea would be to not call LogStandbySnapshot() when
>> we are still at the beginning of a new segment. We know that the first page
>> of a WAL segment has a size of SizeOfXLogLongPHD, so just having a check on
>> that sounds enough to me. Per se the patch attached that should be applied
>> down to 9.4. This fixes the regression reported by Laurence for me.
>
> This bug fix is registered in next CF so as we do not lose track of it;
> https://commitfest.postgresql.org/7/398/

Andres has mentioned me during Postgres Europe that instead of looking
at if the last inserted record was at the beginning of a new segment,
we had better check if some progress has been done since the last
checkpoint that happened. Attached is a patch adding some logic to
track the LSN position of the last checkpoint record created, and log
the standby activity only if some progress has been done since. It
seems that we had better be sure that the last checkpoint record is
neither the last inserted record, nor the one previously inserted
before logging the standby activity, as a XLOG_STANDBY_LOCK record may
be added in between.
Regards,
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: BUG #13667: SSI violation...
Next
From: Michael Paquier
Date:
Subject: Re: BUG #13741: vacuumdb does not accept valid password