From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
---|---|
To: | Ajin Cherian <itsajin(at)gmail(dot)com> |
Cc: | Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Nikhil Sontakke <nikhils(at)2ndquadrant(dot)com> |
Subject: | Re: Track replica origin progress for Rollback Prepared |
Date: | 2021-01-12 13:13:46 |
Message-ID: | CAA4eK1LYHsjekzuA8=W6DkKRxqBOZXqEZY2yrQqyuUbHpj3M=g@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Jan 12, 2021 at 3:18 PM Ajin Cherian <itsajin(at)gmail(dot)com> wrote:
>
> On Wed, Jan 6, 2021 at 11:56 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
>
> > Now, let us see how the tests mentioned by me cover this code. In the
> > first test (check that 2PC gets replicated to subscriber then ROLLBACK
> > PREPARED), we do below on publisher and wait for it to be applied on
> > the subscriber.
> > BEGIN;
> > INSERT INTO tab_full VALUES (12);
> > PREPARE TRANSACTION 'test_prepared_tab_full';
> > ROLLBACK PREPARED 'test_prepared_tab_full';
>
..
>
> Also restarted server2 and confirmed that the rollback prepared was
> not re-sent again.
>
Thanks for doing these tests. I think you can put an elog in the below
code change as well to show that the recovery code path is also hit:
+xact_redo_abort(xl_xact_parsed_abort *parsed, TransactionId xid,
+ XLogRecPtr lsn, RepOriginId origin_id)
{
...
+ if (parsed->xinfo & XACT_XINFO_HAS_ORIGIN)
+ {
+ /* recover apply progress */
+ replorigin_advance(origin_id, parsed->origin_lsn, lsn,
+ false /* backward */, false /* WAL */);
+ }
--
With Regards,
Amit Kapila.
From | Date | Subject | |
---|---|---|---|
Next Message | Heikki Linnakangas | 2021-01-12 13:49:36 | Re: Yet another fast GiST build |
Previous Message | Peter Smith | 2021-01-12 12:47:09 | Re: Single transaction in the tablesync worker? |