Re: Which process is actually doing the WAL writes/calls XLogFlush?

From: Daniel Westermann <daniel(dot)westermann(at)dbi-services(dot)com>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Subject: Re: Which process is actually doing the WAL writes/calls XLogFlush?
Date: 2017-06-27 18:19:21
Message-ID: 1362692788.73958.1498587561122.JavaMail.zimbra@dbi-services.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>On 06/23/2017 05:50 AM, Daniel Westermann wrote:
>> Hi all,
>>
>> as I did not find the answer in the documentation: Which background
>> process is actually doing the writes/flushes to the WAL? In the docs
>> ( https://www.postgresql.org/docs/10/static/wal-configuration.html ) it is
>> explained which internal functions are responsible for this:
>> XLogInsertRecord and XLogFlush but who does call them, especially the
>> flush? Is it the process for the user connection itself then which calls
>> this after commit?
>
>For all the details see here:
>
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/access/transam/README;h=4ae4715339e707ab5ed879a628aa96b73002ef43;hb=6a18e4bc2d13d077c52cf90a4c6ec68343808ba7 >
>>
>> Initially I thought it is the job of the wal_writer but according to
>> this blog post
>> ( http://www.cybertec.at/postgresql-writer-and-wal-writer-processes-explained/ )
>> this seems not to be true, right? Why do I need the wal_writer at all
>> then when synchronous_commit is set to something else than off?
>
>See here:
>
> https://www.postgresql.org/docs/9.6/static/wal-async-commit.html
Thanks, Adrian
It is clear now for the asynchronous stuff and wal_writer.
But I still did not figure out (or I am just not able to understand it from the README linked above)
which process is actually doing the write to the wal when you have synchronous commit set to on. Can
someone put some light on this?

Thanks
Daniel

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2017-06-27 18:47:39 Re: Which process is actually doing the WAL writes/calls XLogFlush?
Previous Message Albe Laurenz 2017-06-27 15:36:20 Re: Re: Unable to understand index only scan as it is not happening for one table while it happens for other