Re: Is Recovery actually paused? - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Is Recovery actually paused?
Date
Msg-id CALj2ACWEcqnKWgrUKw8VOPBkCHs0TjRDTDemda-rmHLr_gBD3Q@mail.gmail.com
Whole thread Raw
In response to Re: Is Recovery actually paused?  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Is Recovery actually paused?  (Dilip Kumar <dilipbalaut@gmail.com>)
List pgsql-hackers
On Fri, Feb 5, 2021 at 10:14 AM Bharath Rupireddy
<bharath.rupireddyforpostgres@gmail.com> wrote:
> > We can not do that, basically, under one lock we need to check the
> > state and set it to pause.  Because by the time you release the lock
> > someone might set it to RECOVERY_NOT_PAUSED then you don't want to set
> > it to RECOVERY_PAUSED.
>
> Got it. Thanks.

Hi Dilip, I have one more question:

+        /* test for recovery pause, if user has requested the pause */
+        if (((volatile XLogCtlData *) XLogCtl)->recoveryPauseState ==
+            RECOVERY_PAUSE_REQUESTED)
+            recoveryPausesHere(false);
+
+        now = GetCurrentTimestamp();
+

Do we need  now = GetCurrentTimestamp(); here? Because, I see that
whenever the variable now is used within the for loop in
WaitForWALToBecomeAvailable, it's re-calculated anyways. It's being
used within case XLOG_FROM_STREAM:

Am I missing something?

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Kazutaka Onishi
Date:
Subject: Re: TRUNCATE on foreign table
Next
From: Dilip Kumar
Date:
Subject: Re: Is Recovery actually paused?