Re: pg_replication_slot_advance to return NULL instead of 0/0 if slotnot advanced

Поиск
Список
Период
Сортировка
От Petr Jelinek
Тема Re: pg_replication_slot_advance to return NULL instead of 0/0 if slotnot advanced
Дата
Msg-id 73f4672f-f71a-37d7-a8dc-8e406e4b5728@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: pg_replication_slot_advance to return NULL instead of 0/0 ifslot not advanced  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: pg_replication_slot_advance to return NULL instead of 0/0 ifslot not advanced  (Michael Paquier <michael@paquier.xyz>)
Re: pg_replication_slot_advance to return NULL instead of 0/0 ifslot not advanced  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Hi,

On 01/06/18 21:13, Michael Paquier wrote:
> -    startlsn = MyReplicationSlot->data.confirmed_flush;
> +    if (OidIsValid(MyReplicationSlot->data.database))
> +        startlsn = MyReplicationSlot->data.confirmed_flush;
> +    else
> +        startlsn = MyReplicationSlot->data.restart_lsn;
> +
>      if (moveto < startlsn)
>      {
>          ReplicationSlotRelease();

This part looks correct for the checking that we are not moving
backwards. However, there is another existing issue with this code which
is that we are later using the confirmed_flush (via startlsn) as start
point of logical decoding (XLogReadRecord parameter in
pg_logical_replication_slot_advance) which is not correct. The
restart_lsn should be used for that. I think it would make sense to fix
that as part of this patch as well.

-- 
  Petr Jelinek                  http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: plans for PostgreSQL 12
Следующее
От: tushar
Дата:
Сообщение: Re: New committers announced at PGCon 2018