BUG #14999: pg_rewind corrupts control file global/pg_control - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #14999: pg_rewind corrupts control file global/pg_control
Date
Msg-id 20180104200633.17004.16377@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #14999: pg_rewind corrupts control file global/pg_control
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14999
Logged by:          Christian H.
Email address:      office@tiptop-labs.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 .


pgsql-bugs by date:

Previous
From: Sergei Kornilov
Date:
Subject: Re: BUG #14998: XXS vulnerabilities in PostgreSQL 'utf8 4-byte truncation'
Next
From: Alexander Korotkov
Date:
Subject: Re: Fwd: [BUGS] pg_trgm word_similarity inconsistencies or bug