RE: BUG: Former primary node might stuck when started as a standby - Mailing list pgsql-hackers

From Hayato Kuroda (Fujitsu)
Subject RE: BUG: Former primary node might stuck when started as a standby
Date
Msg-id OS9PR01MB121498EFA4CBF3003B83C9BCCF56CA@OS9PR01MB12149.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: BUG: Former primary node might stuck when started as a standby  (Alexander Lakhin <exclusion@gmail.com>)
Responses Re: BUG: Former primary node might stuck when started as a standby
List pgsql-hackers
Dear Alexander,

> From my old records, 009_twophase.pl failed exactly due to background (
> namely, bgwriter's) activity.

Okay, so I think there are two reasons why the test could fail.

1) old primary shut down before all changes are replicated. This can avoid by
adding wait_for_replay_catchup() before the tearing down.
2) bgwriter on old primary generated the RUNNING_XACTS record and the node shut
dwon before sending it.

.. and you mentioned for the case 2), right? I recalled that an injection point
"skip-log-running-xacts" can be used to supress generating the WAL record, see
035_standby_logical_decoding.pl. My idea is to attach the injeciton point before
the switchover and avoid adding the record.
Attached patch implements the idea.

How do you feel?

Best regards,
Hayato Kuroda
FUJITSU LIMITED


Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Having problems generating a code coverage report
Next
From: vignesh C
Date:
Subject: Re: Skipping schema changes in publication