Re: [Patch] ALTER SYSTEM READ ONLY
Robert Haas <robertmhaas@gmail.com>
On Wed, Sep 15, 2021 at 6:49 AM Amul Sul <sulamul@gmail.com> wrote: > Initially, I thought to > use SharedRecoveryState which is always set to RECOVERY_STATE_ARCHIVE, > if the archive recovery requested. But there is another case where > SharedRecoveryState could be RECOVERY_STATE_ARCHIVE irrespective of > ArchiveRecoveryRequested value, that is the presence of a backup label > file. Right, there's a difference between whether archive recovery has been *requested* and whether it is actually *happening*. > If we want to use SharedRecoveryState, we need one more state > which could differentiate between ArchiveRecoveryRequested and the > backup label file presence case. To move ahead, I have copied > ArchiveRecoveryRequested into shared memory and it will be cleared > once archive cleanup is finished. With all these changes, we could get > rid of xlogaction argument and DetermineRecoveryXlogAction() function. > Could move its logic to PerformRecoveryXLogAction() directly. Putting these changes into 0001 seems to make no sense. It seems like they should be part of 0003, or maybe a new 0004 patch. > And for ThisTimeLineID, I don't think we need to do anything since this > value is available with all the backend as per the following comment: > " > /* > * ThisTimeLineID will be same in all backends --- it identifies current > * WAL timeline for the database system. > */ > TimeLineID ThisTimeLineID = 0; I'm not sure I find that argument totally convincing. The two variables aren't assigned at exactly the same places in the code, nonwithstanding the comment. I'm not saying you're wrong. I'm just saying I don't believe it just because the comment says so. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Initialize variable to placate compiler.
- a030a0c5ccb1 15.0 landed
-
StartupXLOG: Don't repeatedly disable/enable local xlog insertion.
- 18e0913a4203 15.0 landed
-
StartupXLOG: Call CleanupAfterArchiveRecovery after XLogReportParameters.
- a75dbf7f9ee6 15.0 landed
-
Postpone some end-of-recovery operations related to allowing WAL.
- 811051c2e7af 15.0 landed
-
Refactor some end-of-recovery code out of StartupXLOG().
- 6df1543abfed 15.0 landed
-
Re-enable contrib/bloom's TAP tests.
- 7d1aa6bf1c27 15.0 cited
-
Remove unnecessary call to ReadCheckpointRecord().
- 1d919de5eb3f 15.0 cited
-
Allow for error or refusal while absorbing a ProcSignalBarrier.
- a3ed4d1efe9f 14.0 landed
-
Add comment to explain an unused function parameter
- 101f903e51f5 14.0 cited
-
Extend the ProcSignal mechanism to support barriers.
- 16a4e4aecd47 13.0 cited
-
At promotion, don't leave behind a partial segment on the old timeline.
- 7cbee7c0a1db 9.5.0 cited