| From: | Thomas Munro <tmunro(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Refactor confusing code in _mdfd_openseg(). |
| Date: | 2020-01-26 20:16:36 |
| Message-ID: | E1ivoKi-0001nV-63@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
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(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2020-01-26 21:32:30 | pgsql: Fix EXPLAIN (SETTINGS) to follow policy about when to print empt |
| Previous Message | Tom Lane | 2020-01-26 19:31:30 | pgsql: In postgres_fdw, don't try to ship MULTIEXPR updates to remote s |