Re: Is Recovery actually paused?
Dilip Kumar <dilipbalaut@gmail.com>
From: Dilip Kumar <dilipbalaut@gmail.com>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>,
Yugo Nagata <nagata@sraoss.co.jp>, Masahiko Sawada <sawada.mshk@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Simon Riggs <simon@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-02-07T13:57:02Z
Lists: pgsql-hackers
Attachments
- v12-0001-Provide-a-new-interface-to-get-the-recovery-paus.patch (text/x-patch) patch v12-0001
On Sun, Feb 7, 2021 at 6:44 PM Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote: > > 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? Yeah, I don't see any reason for doing this, maybe it got copy pasted by mistake. Thanks for observing this. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com
Commits
-
Be clear about whether a recovery pause has taken effect.
- 32fd2b57d7f6 14.0 landed
-
Pause recovery for insufficient parameter settings
- 15251c0a60be 14.0 cited
-
Remove most volatile qualifiers from xlog.c
- 6ba4ecbf477e 9.5.0 cited