Re: Read consistency when using synchronous_commit=off

From: Fabio Pardi <f(dot)pardi(at)portavita(dot)eu>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Read consistency when using synchronous_commit=off
Date: 2019-01-15 11:39:50
Message-ID: 0422a97d-59c6-5812-2ba9-7687c564ad94@portavita.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

After better thinking, I have to reply to myself since I m not entirely sure of my previous question. (I m digging into the docs, but i do not want to mislead you in the meanwhile)

If i recall correctly, written data is parked in WAL buffer before being synced to disk (to the transaction log).

I m not sure other clients are able to read from WAL buffer, therefore i m not sure the data is available to other clients at that specific point in time.

Maybe somebody else in the ML knows the details by heart?

regards,

fabio pardi

On 15/01/2019 12:15, Fabio Pardi wrote:
> Hi,
>
> all clients will get the latest version of the row (from RAM, that is). The only thing is that in case of server crash, not-yet-written-to-disk commits will be lost.
>
> detailed explanation can be found here:
>
> https://www.postgresql.org/docs/current/wal-async-commit.html
>
> regards,
>
> fabio pardi 
>
>
> On 15/01/2019 11:58, pshadangi wrote:
>> To improve commit performance we are planning to use "synchronous_commit=off", with this if multiple clients are reading the same data/row will they always get the latest updated data/row ? (clients are using committed read and we are not using clustered environment, we have just one instance of postgres serving local clients running on the same machine).
>> For example if client1 updates a row then the updated value is available to client2 immediately after the commit or there is a delay as commit is now asynchronous ?
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ian Barwick 2019-01-15 11:41:37 Re: repmgr and STONIT - SPLIT BAIN
Previous Message Fabio Pardi 2019-01-15 11:15:45 Re: Read consistency when using synchronous_commit=off