From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor confusing code in _mdfd_openseg().
Date: Sun, 26 Jan 2020 20:16:36 +0000
Message-ID: <E1ivoKi-0001nV-63@gemulon.postgresql.org> (raw)
Refactor confusing code in _mdfd_openseg().
As reported independently by a couple of people, _mdfd_openseg() is coded in a
way that seems to imply that the segments could be opened in an order that
isn't strictly sequential. Even if that were true, it's also using the wrong
comparison. It's not an active bug, since the condition is always true anyway,
but it's confusing, so replace it with an assertion.
Author: Thomas Munro
Reviewed-by: Andres Freund, Kyotaro Horiguchi, Noah Misch
Discussion: https://postgr.es/m/CA%2BhUKG%2BNBw%2BuSzxF1os-SO6gUuw%3DcqO5DAybk6KnHKzgGvxhxA%40mail.gmail.com
Discussion: https://postgr.es/m/20191222091930.GA1280238%40rfd.leadboat.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f37ff03478aefb5e01d748b85ad86e6213624992
Modified Files
--------------
src/backend/storage/smgr/md.c | 9 +++++++--
1 file changed, 7 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: tmunro@postgresql.org
Subject: Re: pgsql: Refactor confusing code in _mdfd_openseg().
In-Reply-To: <E1ivoKi-0001nV-63@gemulon.postgresql.org>
References: <E1ivoKi-0001nV-63@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