Re: [GENERAL] Sequence moves forward when failover is triggerred

2012-07-11 Thread Craig Ringer
On 07/12/2012 04:17 AM, Steve Crawford wrote: The stickier issue is queuing. You have multiple users and need to ensure that you grab an unused check from the book but each concurrent user needs to get a different check. "Select from checkbook where not check_used order by check_no limit 1 for

Re: [GENERAL] Sequence moves forward when failover is triggerred

2012-07-11 Thread Steve Crawford
On 07/10/2012 04:23 PM, Andy Chambers wrote: On Tue, Jul 10, 2012 at 6:48 PM, Tom Lane > wrote: Andy Chambers mailto:achamb...@mcna.net>> writes: > When testing the failover procedure, we noticed that when the new master > comes up, some sequences have

Re: [GENERAL] Sequence moves forward when failover is triggerred

2012-07-11 Thread Berend Tober
Craig Ringer wrote: On 07/11/2012 07:23 AM, Andy Chambers wrote: I think I made a poor decision by having our application generate checkbook numbers on demand using sequences. Sure did. Sequences are exempt from most transactional rules; that's why they're fast and lock-free. This may be a

Re: [GENERAL] Sequence moves forward when failover is triggerred

2012-07-10 Thread Craig Ringer
On 07/11/2012 07:23 AM, Andy Chambers wrote: I think I made a poor decision by having our application generate checkbook numbers on demand using sequences. Sure did. Sequences are exempt from most transactional rules; that's why they're fast and lock-free. I'm surprised to find that the on

Re: [GENERAL] Sequence moves forward when failover is triggerred

2012-07-10 Thread Andy Chambers
On Tue, Jul 10, 2012 at 6:48 PM, Tom Lane wrote: > Andy Chambers writes: > > When testing the failover procedure, we noticed that when the new master > > comes up, some sequences have moved forward (by between 30 and 40). I > see > > there's a "cache" option when creating the sequence but we're

Re: [GENERAL] Sequence moves forward when failover is triggerred

2012-07-10 Thread Tom Lane
Andy Chambers writes: > When testing the failover procedure, we noticed that when the new master > comes up, some sequences have moved forward (by between 30 and 40). I see > there's a "cache" option when creating the sequence but we're not using > that. > Is this to be expected? Yes. This is

[GENERAL] Sequence moves forward when failover is triggerred

2012-07-10 Thread Andy Chambers
Hey All, We used the linked guide to setup streaming replication. http://wiki.postgresql.org/wiki/Streaming_Replication When testing the failover procedure, we noticed that when the new master comes up, some sequences have moved forward (by between 30 and 40). I see there's a "cache" option whe