Re: Confused about a statement in WAL configs

From: Jeremy Finzel <finzelj(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-docs(at)postgresql(dot)org" <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Confused about a statement in WAL configs
Date: 2017-08-01 14:23:29
Message-ID: CAMa1XUhUDbtFd1X3wvNBBd3a0aAGF7Y73JO2QCj2kYELzi9mMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Mon, Jul 31, 2017 at 10:04 AM, David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Mon, Jul 31, 2017 at 6:16 AM, <finzelj(at)gmail(dot)com> wrote:
>
>> The following documentation comment has been logged on the website:
>>
>> Page: https://www.postgresql.org/docs/9.6/static/wal-configuration.html
>> Description:
>>
>> In this section:
>>
>> &quot;At checkpoint time, all dirty data pages are flushed to disk and a
>> special
>> checkpoint record is written to the log file. (The change records were
>> previously flushed to the WAL files.)&quot;
>>
>> I am confused by what the part in parenthesis means by
>> &quot;previously&quot;. This
>> may only reflect my ignorance, but I don&#39;t know if
>> &quot;previously&quot; means &quot;in
>> previous versions of Postgres&quot; or &quot;before the checkpoint&quot;
>> or something
>> else.
>>
>> Mostly because of this, I don&#39;t understand what this statement
>> means. Thank
>> you.
>>
>
> ​"previously" in that sentence means "earlier in time". The "WAL files"
> are written to during every COMMIT. They constitute a journal of changes
> that affected the in-memory "pages" and made them "dirty". During a
> checkpoint a marker entry is written that says a checkpoint has occurred
> and that every change noted in the WAL files written before the marker
> entry and now known to exist in the actual data files on disk.
>

Forgive me, but I don't quite follow this clause at it's not a complete
sentence: "every change noted in the WAL files written before the marker
entry and now known to exist in the actual data files on disk". Is there a
typo here?

> Until that happens some of those change may only exist in memory (in the
> form of dirty data pages).
>
> David J.​
>

I *think* I follow now: before the checkpoint, the dirty data pages had
already been written to the WAL files, but not necessarily flushed to
disk. The checkpoint flushes them all to disk as well.

If that is the case, I still think the wording is confusing and should be
updated to say that ^^ more explicitly spelled out. For example:

At checkpoint time, all dirty data pages are flushed to disk and a special
checkpoint record is written to the log file. (The change records were
previously flushed only to the WAL files, not necessarily to disk).

Again, if I understand rightly. Thank you.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message David G. Johnston 2017-08-01 14:31:42 Re: Confused about a statement in WAL configs
Previous Message mahsh.baheti 2017-08-01 08:22:40 "data" not "datums"