Re: Sequence moves forward when failover is triggerred
От | Tom Lane |
---|---|
Тема | Re: Sequence moves forward when failover is triggerred |
Дата | |
Msg-id | 8254.1341960491@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Sequence moves forward when failover is triggerred (Andy Chambers <achambers@mcna.net>) |
Ответы |
Re: Sequence moves forward when failover is triggerred
|
Список | pgsql-general |
Andy Chambers <achambers@mcna.net> 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 an artifact of an optimization that reduces the number of WAL records generated by nextval() calls --- server processes will write WAL records that say they've consumed multiple sequence values ahead of where they actually have. AFAICS this is not distinguishably different from the case where a transaction consumes that number of sequence values and then rolls back, so I don't see much wrong with that optimization. regards, tom lane
В списке pgsql-general по дате отправления: