pgsql: Minor cleanup for access/transam/parallel.c.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Minor cleanup for access/transam/parallel.c.
Date: 2016-08-01 20:12:07
Message-ID: E1bUJZH-0007Hl-Kc@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Minor cleanup for access/transam/parallel.c.

ParallelMessagePending *must* be marked volatile, because it's set
by a signal handler. On the other hand, it's pointless for
HandleParallelMessageInterrupt to save/restore errno; that must be,
and is, done at the outer level of the SIGUSR1 signal handler.

Calling CHECK_FOR_INTERRUPTS() inside HandleParallelMessages, which itself
is called from CHECK_FOR_INTERRUPTS(), seems both useless and hazardous.
The comment claiming that this is needed to handle the error queue going
away is certainly misguided, in any case.

Improve a couple of error message texts, and use
ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE to report loss of parallel worker
connection, since that's what's used in e.g. tqueue.c. (Maybe it would be
worth inventing a dedicated ERRCODE for this type of failure? But I do not
think ERRCODE_INTERNAL_ERROR is appropriate.)

Minor stylistic cleanups.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a5fe473ad79d8d2c85a625621c165e8c601274e4

Modified Files
--------------
src/backend/access/transam/parallel.c | 25 ++++++++++++-------------
src/include/access/parallel.h | 13 ++++++-------
2 files changed, 18 insertions(+), 20 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2016-08-02 16:37:26 pgsql: doc: Whitespace fixes in man pages
Previous Message Tom Lane 2016-08-01 19:14:09 pgsql: Don't CHECK_FOR_INTERRUPTS between WaitLatch and ResetLatch.