Re: odd buildfarm failure - "pg_ctl: control file appears to be corrupt"

Anton A. Melnikov <aamelnikov@inbox.ru>

From: "Anton A. Melnikov" <aamelnikov@inbox.ru>
To: Thomas Munro <thomas.munro@gmail.com>, Stephen Frost <sfrost@snowman.net>
Cc: Daniel Gustafsson <daniel@yesql.se>, Tom Lane <tgl@sss.pgh.pa.us>, Andres Freund <andres@anarazel.de>, David Steele <david@pgmasters.net>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2023-07-30T19:22:49Z
Lists: pgsql-hackers

Attachments

Hello!

On 26.07.2023 07:06, Thomas Munro wrote:
>  New patches
> attached.  Are they getting better?

It seems to me that it is worth focusing efforts on the second part of the patch,
as the most in demand. And try to commit it first.

And seems there is a way to simplify it by adding a parameter to get_controlfile() that will return calculated
crc and moving the repetition logic level up.

There is a proposed algorithm in alg_level_up.pdf attached.

[Excuse me, for at least three days i will be in a place where there is no available Internet. \
So will be able to read this thread no earlier than August 2 evening]

With the best wishes,

-- 
Anton A. Melnikov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Commits

  1. Try to handle torn reads of pg_control in frontend.

  2. Acquire ControlFileLock in relevant SQL functions.