On Mon, Oct 29, 2018 at 4:51 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >> "performsort of -1"? Seems a bit suspicious.
>
> > This just refers to the leader Tuplesortstate. It isn't suspicious.
> > We follow the convention that worker -1 is the leader within
> > tuplesort.c.
>
> Hmm. But the sort of "0" has already completed, according to the first
> couple of log lines I quoted. Why is something still trying to access
> it? Why is a worker trying to do anything at all with the leader's
> Tuplesortstate?
This is almost certainly because the parallel infrastructure generally
doesn't guarantee that log output will be in order. Even if something
bizarre took place with the temporary files, there is no way that the
worker number in trace_sort would change within a worker. It's an
immutable field within Tuplesortstate, initialized once.
> > trace_sort is a developer option, so this seems fine to me.
>
> That's a poor excuse for ignoring the message style guidelines.
> There are many reasons why even experts could get confused trying
> to follow badly-written messages.
I'll change the trace_sort messages to refer to "worker n" -- that
should bring the trace_sort output in line with our style guidelines.
--
Peter Geoghegan