pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix representation of SORT_TYPE_STILL_IN_PROGRESS.
Date: Tue, 07 Apr 2020 02:22:22 +0000
Message-ID: <E1jLdsc-0002tx-1P@gemulon.postgresql.org> (raw)

Fix representation of SORT_TYPE_STILL_IN_PROGRESS.

It turns out that the code did indeed rely on a zeroed
TuplesortInstrumentation.sortMethod field to indicate
"this worker never did anything", although it seems the
issue only comes up during certain race-condition-y cases.

Hence, rearrange the TuplesortMethod enum to restore
SORT_TYPE_STILL_IN_PROGRESS to having the value zero,
and add some comments reinforcing that that isn't optional.

Also future-proof a loop over the possible values of the enum.
sizeof(bits32) happened to be the correct limit value,
but only by purest coincidence.

Per buildfarm and local investigation.

Discussion: https://postgr.es/m/12222.1586223974@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c7654f6a37792ab9525ff98b710c23b27c7868a5

Modified Files
--------------
src/backend/commands/explain.c | 10 +++++-----
src/include/utils/tuplesort.h  | 20 +++++++++++++-------
2 files changed, 18 insertions(+), 12 deletions(-)



Message-ID: <E1jLdsc-0002tx-1P@gemulon.postgresql.org>
Permalink:  ../E1jLdsc-0002tx-1P@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jLdsc-0002tx-1P@gemulon.postgresql.org

 · 

reply

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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix representation of SORT_TYPE_STILL_IN_PROGRESS.
  In-Reply-To: <E1jLdsc-0002tx-1P@gemulon.postgresql.org>
  References: <E1jLdsc-0002tx-1P@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