BUG #14999: pg_rewind corrupts control file global/pg_control

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Cc: office(at)tiptop-labs(dot)com
Subject: BUG #14999: pg_rewind corrupts control file global/pg_control
Date: 2018-01-04 20:06:33
Message-ID: 20180104200633.17004.16377@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

The following bug has been logged on the website:

Bug reference: 14999
Logged by: Christian H.
Email address: office(at)tiptop-labs(dot)com
PostgreSQL version: 10.1
Operating system: e.g. Debian Buster
Description:

I have encountered a bug in PostgreSQL 10.1: when the target directory for
pg_rewind contains a read-only file (e.g. server.key), pg_rewind exits with
"could not open target file" (legitimate) and corrupts the control file
global/pg_control to size 0 (bug). From now on, pg_rewind always exits with
"unexpected control file size 0, expected 8192" and a restore from
pg_basebackup is needed.

A patch for branch REL_10_STABLE of repository
https://github.com/postgres/postgres, a README, and Dockerfiles for
demonstrating both bug and patch are available from
https://github.com/tiptop-labs/postgres-patches .

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Korotkov 2018-01-04 21:25:52 Re: Fwd: [BUGS] pg_trgm word_similarity inconsistencies or bug
Previous Message Sergei Kornilov 2018-01-04 10:09:31 Re: BUG #14998: XXS vulnerabilities in PostgreSQL 'utf8 4-byte truncation'

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-01-04 20:06:47 Re: pgsql: Add parallel-aware hash joins.
Previous Message Tom Lane 2018-01-04 20:03:06 Re: [HACKERS] wrong t_bits alignment in pageinspect