Re: Enumize logical replication message actions

Поиск
Список
Период
Сортировка
От Li Japin
Тема Re: Enumize logical replication message actions
Дата
Msg-id 6C0A4DC4-4DE3-4C1A-975C-09CF33924352@hotmail.com
обсуждение исходный текст
Ответ на Enumize logical replication message actions  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Ответы Re: Enumize logical replication message actions  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-hackers
> On Oct 16, 2020, at 3:25 PM, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote:
> 
> Hi All,
> Logical replication protocol uses single byte character to identify
> different chunks of logical repliation messages. The code uses
> character literals for the same. These literals are used as bare
> constants in code as well. That's true for almost all the code that
> deals with wire protocol. With that it becomes difficult to identify
> the code which deals with a particular message. For example code that
> deals with message type 'B'. In various protocol 'B' has different
> meaning and it gets difficult and time consuming to differentiate one
> usage from other and find all places which deal with one usage. Here's
> a patch simplifying that for top level logical replication messages.
> 
> I think I have covered the places that need change. But I might have
> missed something, given that these literals are used at several other
> places (a problem this patch tries to fix :)).
> 
> Initially I had used #define for the same, but Peter E suggested using
> Enums so that switch cases can detect any remaining items along with
> stronger type checks.
> 
> Pavan offleast suggested to create a wrapper
> pg_send_logical_rep_message() on top of pg_sendbyte(), similarly for
> pg_getmsgbyte(). I wanted to see if this change is acceptable. If so,
> I will change that as well. Comments/suggestions welcome.
> 
> -- 
> Best Wishes,
> Ashutosh Bapat
> <0001-Enumize-top-level-logical-replication-actions.patch>

What about ’N’ for new tuples, ‘O’ for old tuple follows, ‘K’ for old key follows?
Those are also logical replication protocol message, I think.

--
Best regards
Japin Li


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

Предыдущее
От: e.sokolova@postgrespro.ru
Дата:
Сообщение: [PATCH] Add extra statistics to explain for Nested Loop
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: shared-memory based stats collector