Re: sinval synchronization considered harmful - Mailing list pgsql-hackers

From Noah Misch
Subject Re: sinval synchronization considered harmful
Date
Msg-id 20110722192803.GA32389@tornado.leadboat.com
Whole thread Raw
In response to Re: sinval synchronization considered harmful  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: sinval synchronization considered harmful
Re: sinval synchronization considered harmful
List pgsql-hackers
On Thu, Jul 21, 2011 at 11:37:27PM -0400, Robert Haas wrote:
> I think I have a simpler idea, though:
> before acquiring any locks, just have SIGetDataEntries() do this:
> 
> +       if (stateP->nextMsgNum == segP->maxMsgNum && !stateP->resetState)
> +               return 0;
> 
> Patch (with comment explaining why I think this is OK) attached.  If
> the message numbers happen to be equal only because the counter has
> wrapped, then stateP->resetState will be true, so we'll still realize
> we need to do some work.

This is attractive, and I don't see any problems with it.  (In theory, you could
hit a case where the load of resetState gives an ancient "false" just as the
counters wrap to match.  Given that the wrap interval is 1000000x as long as the
reset interval, I'm not worried about problems on actual silicon.)

+1 for doing this and moving on.

-- 
Noah Misch                    http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Policy on pulling in code from other projects?
Next
From: Robert Haas
Date:
Subject: Re: sinval synchronization considered harmful