Re: repeated decoding of prepared transactions
Ajin Cherian <itsajin@gmail.com>
From: Ajin Cherian <itsajin@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-03-01T01:53:17Z
Lists: pgsql-hackers
Attachments
- v7-0001-Avoid-repeated-decoding-of-prepared-transactions-.patch (application/octet-stream) patch v7-0001
- v7-0002-Add-option-to-enable-two-phase-commits-in-pg_crea.patch (application/octet-stream) patch v7-0002
On Sat, Feb 27, 2021 at 11:06 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> Few comments on 0002 patch:
> =========================
> 1.
> +
> + /*
> + * Disable two-phase here, it will be set in the core if it was
> + * enabled whole creating the slot.
> + */
> + ctx->twophase = false;
>
> Typo, /whole/while. I think we don't need to initialize this variable
> here at all.
>
> 2.
> + /* If twophase is set on the slot at create time, then
> + * make sure the field in the context is also updated
> + */
> + if (MyReplicationSlot->data.twophase)
> + {
> + ctx->twophase = true;
> + }
> +
>
> For multi-line comments, the first line of comment should be empty.
> Also, I think this is not the right place because the WALSender path
> needs to set it separately. I guess you can set it in
> CreateInitDecodingContext/CreateDecodingContext by doing something
> like
>
> ctx->twophase &= MyReplicationSlot->data.twophase
Updated accordingly.
>
> 3. I think we can support this option at the protocol level in a
> separate patch where we need to allow it via replication commands (say
> when we support it in CreateSubscription). Right now, there is nothing
> to test all the code you have added in repl_gram.y.
>
Removed that.
> 4. I think we can expose this new option via pg_replication_slots.
>
Done. Added,
regards,
Ajin Cherian
Fujitsu Australia
Commits
-
Add option to enable two_phase commits via pg_create_logical_replication_slot.
- 19890a064ebf 14.0 landed
-
Avoid repeated decoding of prepared transactions after a restart.
- 8bdb1332eb51 14.0 landed
-
Allow decoding at prepare time in ReorderBuffer.
- a271a1b50e9b 14.0 cited