Re: Non-reserved replication slots and slot advancing
От | Andres Freund |
---|---|
Тема | Re: Non-reserved replication slots and slot advancing |
Дата | |
Msg-id | 20180710072630.oosunvidrxjdjdbb@alap3.anarazel.de обсуждение исходный текст |
Ответ на | Re: Non-reserved replication slots and slot advancing (Michael Paquier <michael@paquier.xyz>) |
Ответы |
Re: Non-reserved replication slots and slot advancing
|
Список | pgsql-hackers |
Hi, On 2018-07-10 09:54:28 +0900, Michael Paquier wrote: > > > Also, ERRCODE_FEATURE_NOT_SUPPORTED doesn't quite seem right. How about > > > ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE? > > > > +1 to both of Andres' suggestions. > > Those indeed sound better. What do you think of the attached? Looks generally good. One remark: > + /* A slot whose restart_lsn has never been reserved cannot be advanced */ > + if (XLogRecPtrIsInvalid(MyReplicationSlot->data.restart_lsn)) > + { > + ReplicationSlotRelease(); > + ereport(ERROR, > + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), > + errmsg("cannot advance replication slot that has not previously reserved WAL"))); > + } Why is the ReplicationSlotRelease() needed here? Souldn't the error handling code do so automatically? Greetings, Andres Freund
В списке pgsql-hackers по дате отправления: