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

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: [HACKERS] logical decoding of two-phase transactions
Дата
Msg-id CAA4eK1Ja0-x=MgrQymceFacV6rGU-Au+_TXwXKsU1YPkTHfQGw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] logical decoding of two-phase transactions  (Ajin Cherian <itsajin@gmail.com>)
Список pgsql-hackers
On Sat, Mar 20, 2021 at 7:07 AM Ajin Cherian <itsajin@gmail.com> wrote:
>
> On Sat, Mar 20, 2021 at 1:35 AM Amit Kapila <amit.kapila16@gmail.com> wrote:
>>
>> On Fri, Mar 19, 2021 at 5:03 AM Ajin Cherian <itsajin@gmail.com> wrote:
>> >
>> > Missed the patch - 0001, resending.
>> >
>>
>>
>> @@ -538,10 +550,21 @@ CreateDecodingContext(XLogRecPtr start_lsn,
>> ..
>> + /* Set two_phase_at LSN only if it hasn't already been set. */
>> + if (ctx->twophase && !MyReplicationSlot->data.two_phase_at)
>> + {
>> + MyReplicationSlot->data.two_phase_at = start_lsn;
>> + slot->data.two_phase = true;
>> + ReplicationSlotMarkDirty();
>> + ReplicationSlotSave();
>> + SnapBuildSetTwoPhaseAt(ctx->snapshot_builder, start_lsn);
>> + }
>>
>> What if the walsender or apply worker restarts after setting
>> two_phase_at/two_phase here and updating the two_phase state in
>> pg_subscription? Won't we need to set SnapBuildSetTwoPhaseAt after
>> restart as well?
>
>
> After a restart,   two_phase_at will be set by calling  AllocateSnapshotBuilder with two_phase_at
>

Okay, that makes sense.

-- 
With Regards,
Amit Kapila.



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Logical Replication vs. 2PC
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Maintaining a list of pgindent commits for "git blame" to ignore