From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_resetwal: Prevent division-by-zero errors
Date: Fri, 23 Mar 2018 14:25:04 +0000
Message-ID: <E1ezNcu-0005st-48@gemulon.postgresql.org> (raw)
pg_resetwal: Prevent division-by-zero errors
Handle the case where the pg_control file specifies a WAL segment size
of 0 bytes. This would previously have led to a division by zero error.
Change this to assume the whole file is corrupt and go to guess
everything.
Discussion: https://www.postgresql.org/message-id/a6163ad7-cc99-fdd1-dfad-25df73032ab8%402ndquadrant.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f1a074b146c900bd439b6ef1953866f41b61a669
Modified Files
--------------
src/bin/pg_resetwal/pg_resetwal.c | 4 +--
src/bin/pg_resetwal/t/002_corrupted.pl | 47 ++++++++++++++++++++++++++++++++++
2 files changed, 49 insertions(+), 2 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: peter_e@gmx.net
Subject: Re: pgsql: pg_resetwal: Prevent division-by-zero errors
In-Reply-To: <E1ezNcu-0005st-48@gemulon.postgresql.org>
References: <E1ezNcu-0005st-48@gemulon.postgresql.org>
* 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