| From: | Zhijie Hou <houzhijie22(at)gmail(dot)com> |
|---|---|
| To: | "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com> |
| Cc: | "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "amit(dot)kapila16(at)gmail(dot)com" <amit(dot)kapila16(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com> |
| Subject: | Re: Document prepared transaction lock waits with two_phase subscriptions |
| Date: | 2026-11-17 06:58:58 |
| Message-ID: | 51a90195-3a5c-429b-a978-e639df8bc225@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
On Tue, Nov17, 2026 at 01:25 PM "Hayato Kuroda (Fujitsu)" wrote:
>
> Thanks for posting the patch. I feel the logging should be improved,
> but it might be out-of-scope. Here I focused on the doc patch.
Thanks for the comments.
>
> ```
> + or manually roll back the prepared transaction on the subscriber,
> + disable <literal>two_phase</literal> (see
> + <link linkend="sql-altersubscription-params-set"><literal>ALTER SUBSCRIPTION ... SET</literal></link>)
> + until that transaction is committed on the publisher and replicated
> + again, and then re-enable <literal>two_phase</literal> if required.
> ```
>
> Isn't it better to disable the subscription before rolling back? If
> the publisher runs COMMIT/ROLLBACK PREPARED soon, the resumed apply
> worker raises "prepared transaction ... does not exist" error.
Although I think the ERROR won't affect the recoevry steps as the
transaction can be replicated anyway after disabling the two_phase, I
agree that the suggested order looks cleaner, so changed.
Here is the V3 patches for all branches.
--
Best Regards,
Zhijie Hou
| Attachment | Content-Type | Size |
|---|---|---|
| v3-0001-Document-prepared-transaction-lock-waits-with-two-HEAD-PG18.patch | text/plain | 4.0 KB |
| v3-0001-Document-prepared-transaction-lock-waits-with-two-PG15-PG17.patch | text/plain | 3.5 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Zhijie Hou | 2026-11-17 06:59:55 | Re: Document prepared transaction lock waits with two_phase subscriptions |
| Previous Message | Fujii Masao | 2026-11-17 06:55:14 | Re: FATAL: could not send end-of-streaming message to primary: no COPY in progress |