Re: sinval.c / sinvaladt.c restructuring - Mailing list pgsql-patches

From Tom Lane
Subject Re: sinval.c / sinvaladt.c restructuring
Date
Msg-id 9134.1205714027@sss.pgh.pa.us
Whole thread Raw
In response to sinval.c / sinvaladt.c restructuring  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-patches
Alvaro Herrera <alvherre@commandprompt.com> writes:
> One side effect of this change is that the call to SendPostmasterSignal
> now occurs after the lock has been released.  ISTM this is a good idea
> on general principles (no syscalls in lwlocked code), but I'm wondering
> if I created a thundering hoard problem that did not exist before.

Forgot to reply to this earlier, but I think this is OK.  The test for
setting signal_postmaster is for exact equality of numMsgs to a
threshold, so at least in simple cases only one backend will send the
signal.  You could imagine scenarios where the slowest backend is trying
to catch up and numMsgs oscillates around the threshold, but it seems
unlikely to be a problem in practice.  I concur that moving the signal
out of the locked code is a good thing.  (Maybe move the elog(DEBUG4)
as well?)

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Hash Index Build Patch v2
Next
From: Tom Lane
Date:
Subject: Re: [PERFORM] Very slow (2 tuples/second) sequential scan after bulk insert; speed returns to ~500 tuples/second after commit