Move walreceiver state assignment (to WALRCV_STREAMING) in WalReceiverMain()

From: "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Move walreceiver state assignment (to WALRCV_STREAMING) in WalReceiverMain()
Date: 2023-12-12 15:58:58
Message-ID: 11ff040c-2eca-421a-b74a-0e99937c2d93@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

Currently walrcv->walRcvState is set to WALRCV_STREAMING at the
beginning of WalReceiverMain().

But it seems that after this assignment things could be wrong before the
walreicever actually starts streaming (like not being able to connect
to the primary).

It looks to me that WALRCV_STREAMING should be set once walrcv_startstreaming()
returns true: this is the proposal of this patch.

I don't think the current assignment location is causing any issues, but I
think it's more appropriate to move it like in the attached.

Looking forward to your feedback,

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v1-0001-move-walrcv-walRcvState-assignment-to-WALRCV_STRE.patch text/plain 1.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-12-12 16:06:51 pgsql: Prevent tuples to be marked as dead in subtransactions on standb
Previous Message Tom Lane 2023-12-12 15:48:33 Re: typedefs.list glitches