Re: [Patch] ALTER SYSTEM READ ONLY
Robert Haas <robertmhaas@gmail.com>
On Wed, Sep 15, 2021 at 10:32 AM Robert Haas <robertmhaas@gmail.com> wrote: > 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. After looking at this a little bit more, I think it's really necessary to separate out all of your changes into separate patches at least for initial review. It's particularly important to separate code movement changes from other kinds of changes. 0001 was just moving code before, and so was 0002, but now both are making other changes, which is not easy to see from looking at the 'git diff' output. For that reason it's not so easy to understand exactly what you've changed here and analyze it. I poked around a little bit at these patches, looking for perhaps-interesting global variables upon which the code called from XLogAcceptWrites() would depend with your patches applied. The most interesting ones seem to be (1) ThisTimeLineID, which you mentioned and which may be fine but I'm not totally convinced yet, (2) LocalXLogInsertAllowed, which is probably not broken but I'm thinking we may want to redesign that mechanism somehow to make it cleaner, and (3) CheckpointStats, which is called from RemoveXlogFile which is called from RemoveNonParentXlogFiles which is called from CleanupAfterArchiveRecovery which is called from XLogAcceptWrites. This last one is actually pretty weird already in the existing code. It sort of looks like RemoveXlogFile() only expects to be called from the checkpointer (or a standalone backend) so that it can update CheckpointStats and have that just work, but actually it's also called from the startup process when a timeline switch happens. I don't know whether the fact that the increments to ckpt_segs_recycled get lost in that case should be considered an intentional behavior that should be preserved or an inadvertent mistake. So I think you've covered most of the necessary things here, with probably some more discussion needed on whether you've done the right things... -- 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