Re: ParallelContexts can get confused about which worker is which - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: ParallelContexts can get confused about which worker is which
Date
Msg-id CAA4eK1LBFXYwDmTj3o9EQz9mu6LLrK=1LsQMW12Rppq6b+-bVg@mail.gmail.com
Whole thread Raw
In response to Re: ParallelContexts can get confused about which worker is which  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: ParallelContexts can get confused about which worker is which
List pgsql-hackers
On Sat, Oct 31, 2015 at 11:35 AM, Robert Haas <robertmhaas@gmail.com> wrote:
>
> On Fri, Oct 30, 2015 at 11:24 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> > The other way to fix this is to pass down the index
> > that the leader assigns to any given worker, and have the worker use
> > that index instead of allocating its own separate index after
> > connecting to the DSM segment.  Unfortunately, there's not really a
> > good way to pass that additional information down to the worker right
> > now, but we could fix that pretty easily by adding an additional field
> > to the BackgroundWorker structure, which the worker would then be able
> > to access via MyBgworkerEntry.
>
> Here's a patch implementing that.
>

If we are going to add a new parameter to BackgroundWorker structure,
then the same needs to be updated in docs [1] as well.  I think adding
a new parameter to this structure might require some updations in
client applications. It seems worth to add a note for the same in commit
message, so that same could be reflected in Release Notes.

Also, I don't know why BGW_EXTRALEN needs to be 128 and not 64?
I guess you kept it so that in future if we need to pass more information,
then the same could be used which seems reasonable considering that
this is an exposed structure and we don't want to change it again.

/* Mutex protects remaining fields. */
slock_t mutex;


/* Maximum XactLastRecEnd of any worker. */
XLogRecPtr last_xlog_end;

} FixedParallelState;

Now as above mutex will be used to just protect last_xlog_end, do you
think it is better to modify the comment above mutex declaration?

pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: [PATCH] we have added support for box type in SP-GiST index
Next
From: Bruce Momjian
Date:
Subject: Re: Patent warning about the Greenplum source code