Re: Change GetLastImportantRecPtr's definition? (wasSkip checkpoints, archiving on idle systems.)

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change GetLastImportantRecPtr's definition? (wasSkip checkpoints, archiving on idle systems.)
Date: 2017-05-07 12:38:05
Message-ID: CAB7nPqRj5c2GSohUGDbd1bJjiLyWXq2_D_56tKB8uuCv_5UOJQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

(catching up here)

On Sun, May 7, 2017 at 9:01 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> Turns out this isn't the better fix, because the checkpoint code
> compares with the actual record LSN (rather than the end+1 that
> XLogInsert() returns). We'd start having to do more bookkeeping or more
> complicated computations (subtracting the checkpoint record's size).
> Therefore I've pushed the simple fix mentioned above instead.

Yeah, I have spent some time looking at many details for this stuff...
And using a start LSN location was way easier for the checkpoint skip
checks. e6c44ee looks good to me, except that I would complete this
comment block in xlog.c:
* updated for all insertions, unless the XLOG_MARK_UNIMPORTANT flag
was
* set. lastImportantAt is never cleared, only overwritten by the LSN
of newer
* records. Tracking the WAL activity directly in WALInsertLock has
the
* advantage of not needing any additional locks to update the value.
*/
By just mentioning that the lastImportantAt is updated to the *start*
LSN position of an important record. This will help in avoiding future
confusions.

It turns out that fixing this issue only on HEAD has been a good choice.
--
Michael

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-05-07 14:57:08 Re: pgsql: Improve performance of timezone loading, especially pg_timezone_
Previous Message David Rowley 2017-05-07 09:38:45 Re: pgsql: Improve performance of timezone loading, especially pg_timezone_

Browse pgsql-hackers by date

  From Date Subject
Next Message Francis ANDRE 2017-05-07 13:47:56 Re: [Proposal]: Extends VisualStudio to automatically precompile EmbeddedSQL
Previous Message Noah Misch 2017-05-07 08:23:10 Re: logical replication syntax (was DROP SUBSCRIPTION, query cancellations and slot handling)