Move walreceiver state assignment (to WALRCV_STREAMING) in WalReceiverMain() - Mailing list pgsql-hackers

From Drouvot, Bertrand
Subject Move walreceiver state assignment (to WALRCV_STREAMING) in WalReceiverMain()
Date
Msg-id 11ff040c-2eca-421a-b74a-0e99937c2d93@gmail.com
Whole thread Raw
Responses Re: Move walreceiver state assignment (to WALRCV_STREAMING) in WalReceiverMain()
List 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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: typedefs.list glitches
Next
From: "Euler Taveira"
Date:
Subject: Re: Move walreceiver state assignment (to WALRCV_STREAMING) in WalReceiverMain()