pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: vignesh C <vignesh21@gmail.com>
Cc: Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Race condition in FetchTableStates() breaks synchronization of subscription tables
Date: Thu, 8 Feb 2024 21:00:01 +0300
Message-ID: <b7ff6571-db9b-bc90-6d1f-f86c4b0fb768@gmail.com> (raw)
In-Reply-To: <CALDaNm0X8oUiW1CzniPZsDxqjP-VoYuEvb1h7NFXohKc1P5HEw@mail.gmail.com>
References: <711a6afe-edb7-1211-cc27-1bef8239eec7@gmail.com>
	<CALDaNm2=SjA_=e9bhYO0ChBm-Wdh-=HYF0RHsR+_2gnqwcyOkg@mail.gmail.com>
	<OS0PR01MB5716B4C05F90F59C0ED227C2947D2@OS0PR01MB5716.jpnprd01.prod.outlook.com>
	<CALDaNm1n-EHOAU7MMoVCEBOmX_V40dfpB1XTpETDk4qQivXXUg@mail.gmail.com>
	<OS0PR01MB5716DBE439D9D3BA6D16DD8C947D2@OS0PR01MB5716.jpnprd01.prod.outlook.com>
	<CALDaNm0hP4J6fbmsNDWBTbb8GxcM=YkB=tjdJbWFTocB8u4MQQ@mail.gmail.com>
	<858a7622-2c81-1687-d1df-1322dfcb2e72@gmail.com>
	<CALDaNm16SW3X2snvTKu-YQxGWGhjWLWj5H9eqXc-bTK4inUtJw@mail.gmail.com>
	<a50d1da6-e3fb-1f06-0ae4-8e038d1c4d85@gmail.com>
	<CALDaNm0X8oUiW1CzniPZsDxqjP-VoYuEvb1h7NFXohKc1P5HEw@mail.gmail.com>

08.02.2024 12:25, vignesh C wrote:
> Yes, the wakeup call sent by the "CREATE SUBSCRIPTION" command was
> getting missed in this case. The wakeup call can be sent during
> subscription creation/modification and when the apply worker exits.
> WaitForReplicationWorkerAttach should not reset the latch here as it
> will end up delaying the apply worker to get started after 180 seconds
> timeout(DEFAULT_NAPTIME_PER_CYCLE). The attached patch does not reset
> the latch and lets ApplyLauncherMain to reset the latch and checks if
> any new worker or missing worker needs to be started.

Thank you for the updated patch!
I ran all the subscription tests in a loop (with the sleeps added as
before) and observed no failures and 180+ seconds duration.

Best regards,
Alexander





view thread (25+ messages)  latest in thread

Message-ID: <b7ff6571-db9b-bc90-6d1f-f86c4b0fb768@gmail.com>
Permalink:  ../b7ff6571-db9b-bc90-6d1f-f86c4b0fb768@gmail.com/
Also on:    postgresql.org/message-id/b7ff6571-db9b-bc90-6d1f-f86c4b0fb768@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: exclusion@gmail.com, vignesh21@gmail.com, houzj.fnst@fujitsu.com
  Subject: Re: Race condition in FetchTableStates() breaks synchronization of subscription tables
  In-Reply-To: <b7ff6571-db9b-bc90-6d1f-f86c4b0fb768@gmail.com>
  References: <711a6afe-edb7-1211-cc27-1bef8239eec7@gmail.com> <CALDaNm2=SjA_=e9bhYO0ChBm-Wdh-=HYF0RHsR+_2gnqwcyOkg@mail.gmail.com> <OS0PR01MB5716B4C05F90F59C0ED227C2947D2@OS0PR01MB5716.jpnprd01.prod.outlook.com> <CALDaNm1n-EHOAU7MMoVCEBOmX_V40dfpB1XTpETDk4qQivXXUg@mail.gmail.com> <OS0PR01MB5716DBE439D9D3BA6D16DD8C947D2@OS0PR01MB5716.jpnprd01.prod.outlook.com> <CALDaNm0hP4J6fbmsNDWBTbb8GxcM=YkB=tjdJbWFTocB8u4MQQ@mail.gmail.com> <858a7622-2c81-1687-d1df-1322dfcb2e72@gmail.com> <CALDaNm16SW3X2snvTKu-YQxGWGhjWLWj5H9eqXc-bTK4inUtJw@mail.gmail.com> <a50d1da6-e3fb-1f06-0ae4-8e038d1c4d85@gmail.com> <CALDaNm0X8oUiW1CzniPZsDxqjP-VoYuEvb1h7NFXohKc1P5HEw@mail.gmail.com> <b7ff6571-db9b-bc90-6d1f-f86c4b0fb768@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox