Re: Streaming replication: sequences on slave seemingly ahead of sequences on master

Поиск
Список
Период
Сортировка
От Vincent de Phily
Тема Re: Streaming replication: sequences on slave seemingly ahead of sequences on master
Дата
Msg-id 2151001.fp1eoNEqON@moltowork
обсуждение исходный текст
Ответ на Re: Streaming replication: sequences on slave seemingly ahead of sequences on master  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: Streaming replication: sequences on slave seemingly ahead of sequences on master  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Streaming replication: sequences on slave seemingly ahead of sequences on master  (Michael Nolan <htfoot@gmail.com>)
Список pgsql-general
On Sunday 06 May 2012 10:29:17 Simon Riggs wrote:
> On 4 May 2012 14:55, Vincent de Phily <vincent.dephily@mobile-devices.fr>
wrote:
> > It all seems to be working fine, except that when checking the data
> > (selecting latest primary key and sequence value for all tables) on
> > master and slave, some sequence ids are higher on the slave than on the
> > master. I could understand if they were lower, but this is weird.
> >
> > * The slave's sequences can be anywhere between 1 and 50 ids ahead.
>
> This is normal. The sequences are advanced in chunks of 100, so the
> master's value will be the nextval() while the value on standby will
> be the start of the next chunk, so as you say, slightly ahead of the
> master.
>
> The same thing would also happen in case of a crash.

Thanks for the explanation (Michael's too).

Would be nice to see it added to the documentation (unless I just didn't find
it ?), as it is quite surprising, and might lead to problems if people expect
to be able to read sequence values from the slave.

As a bonus question, I guess it would be the same if using synchroneous
replication ?

--
Vincent de Phily

В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Nolan
Дата:
Сообщение: Re: Lost one tablespace - can't access whole database
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Streaming replication: sequences on slave seemingly ahead of sequences on master