Search Postgresql Archives

Re: Sequences / Replication

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jonathan Eastgate wrote:
> We're seeing some odd behaviour from a PostgreSQL group - one running as primary and the other as a
> hot slave using streaming replication.
> 
> When a failover event occurs and we switch to the hot slave as primary sequences in tables jump by 33
> - so where the last number allocated in the sequence was 100 prior to failover once adding the next
> entry the sequence will produce the number 133.

That is working as expected.

When nextval() is called, a number of sequence numbers are reserved (by default one,
you can set this with the CACHE clause of CREATE SEQUENCE).  If the transaction is aborted,
these entries won't be used.

So if there were 30 inserting transactions when your server went down that got aborted,
that would explain the behaviour quite nicely.

This should not be a problem.

Yours,
Laurenz Albe

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux