Re: [HACKERS] logical decoding of two-phase transactions

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] logical decoding of two-phase transactions
Date: 2021-03-09 04:21:50
Message-ID: CALDaNm2OyDmf4EJr9o0ZNWeQ+F7CUcS=L4zs=X_PZZN+_3V=8w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 9, 2021 at 9:14 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> On Mon, Mar 8, 2021 at 4:58 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> >
> > LOGICAL_REP_MSG_TYPE = 'Y',
> > + LOGICAL_REP_MSG_BEGIN_PREPARE = 'b',
> > + LOGICAL_REP_MSG_PREPARE = 'P',
> > + LOGICAL_REP_MSG_COMMIT_PREPARED = 'K',
> > + LOGICAL_REP_MSG_ROLLBACK_PREPARED = 'r',
> > LOGICAL_REP_MSG_STREAM_START = 'S',
> > LOGICAL_REP_MSG_STREAM_END = 'E',
> > LOGICAL_REP_MSG_STREAM_COMMIT = 'c',
> > - LOGICAL_REP_MSG_STREAM_ABORT = 'A'
> > + LOGICAL_REP_MSG_STREAM_ABORT = 'A',
> > + LOGICAL_REP_MSG_STREAM_PREPARE = 'p'
> > } LogicalRepMsgType;
> > As we start adding more and more features, we will have to start
> > adding more message types, using meaningful characters might become
> > difficult. Should we start using numeric instead for the new feature
> > getting added?
>
> This may or may not become a problem sometime in the future, but I
> think the feedback is not really specific to the current patch set so
> I am skipping it at this time.
>
> If you want, maybe create it as a separate thread, Is it OK?

I was thinking of changing the newly added message types to something
like below:
> LOGICAL_REP_MSG_TYPE = 'Y',
> + LOGICAL_REP_MSG_BEGIN_PREPARE = 1,
> + LOGICAL_REP_MSG_PREPARE = 2,
> + LOGICAL_REP_MSG_COMMIT_PREPARED = 3,
> + LOGICAL_REP_MSG_ROLLBACK_PREPARED = 4,
> LOGICAL_REP_MSG_STREAM_START = 'S',
> LOGICAL_REP_MSG_STREAM_END = 'E',
> LOGICAL_REP_MSG_STREAM_COMMIT = 'c',
> - LOGICAL_REP_MSG_STREAM_ABORT = 'A'
> + LOGICAL_REP_MSG_STREAM_ABORT = 'A',
> + LOGICAL_REP_MSG_STREAM_PREPARE = 5
> } LogicalRepMsgType;

Changing these values at a later time may become difficult as it can
break backward compatibility. But if you feel the existing values are
better we can keep it as it is and think of it later when we add more
message types.

Regards,
Vignesh

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-03-09 04:44:16 Re: [HACKERS] logical decoding of two-phase transactions
Previous Message bucoo@sohu.com 2021-03-09 03:51:03 Re: POC: converting Lists into arrays