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