pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Nathan Bossart <nathandbossart@gmail.com>
Cc: Melanie Plageman <melanieplageman@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: race condition when writing pg_control
Date: Thu, 16 May 2024 15:01:31 -0400
Message-ID: <2138498.1715886091@sss.pgh.pa.us> (raw)
In-Reply-To: <20240516185805.hnbt2tr23q7xbx3m@awork3.anarazel.de>
References: <20200527071053.GD103662@paquier.xyz>
	<fc796148-7d63-47bb-e91d-e09b62a502e9@oss.nttdata.com>
	<A9F111A3-560A-4C21-A35B-9D3182704187@amazon.com>
	<20200602052427.GC3594@paquier.xyz>
	<CA+hUKGJJJOP1jfw4yRqozXghiqtXRH0gisHyNwa+nzCL_xyjcg@mail.gmail.com>
	<20200603020259.GA89559@paquier.xyz>
	<CA+hUKGKToqjdeRtr8ZHVbPToShun5ifjioj6x3nsjseOkhCMEQ@mail.gmail.com>
	<CAAKRu_YNGwEYrorQYza_W8tU+=toXRHG8HpyHC-KDbZqA_ZVSA@mail.gmail.com>
	<20240516183558.GA1620903@nathanxps13>
	<2136775.1715885450@sss.pgh.pa.us>
	<20240516185805.hnbt2tr23q7xbx3m@awork3.anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> On 2024-05-16 14:50:50 -0400, Tom Lane wrote:
>> The intention was certainly always that it be atomic.  If it isn't
>> we have got *big* trouble.

> We unfortunately do *know* that on several systems e.g. basebackup can read a
> partially written control file, while the control file is being
> updated.

Yeah, but can't we just retry that if we get a bad checksum?

What had better be atomic is the write to disk.  Systems that can't
manage POSIX semantics for concurrent reads and writes are annoying,
but not fatal ...

			regards, tom lane





view thread (32+ messages)  latest in thread

Message-ID: <2138498.1715886091@sss.pgh.pa.us>
Permalink:  ../2138498.1715886091@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2138498.1715886091@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, nathandbossart@gmail.com, melanieplageman@gmail.com, thomas.munro@gmail.com, michael@paquier.xyz, masao.fujii@oss.nttdata.com
  Subject: Re: race condition when writing pg_control
  In-Reply-To: <2138498.1715886091@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox