Re: New strategies for freezing, advancing relfrozenxid early
От | Peter Geoghegan |
---|---|
Тема | Re: New strategies for freezing, advancing relfrozenxid early |
Дата | |
Msg-id | CAH2-WzkTThXif2rcMLcBTqZNYLeJe-6dVVVC_SaTDWYTC3gdPg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: New strategies for freezing, advancing relfrozenxid early (Peter Geoghegan <pg@bowt.ie>) |
Ответы |
RE: New strategies for freezing, advancing relfrozenxid early
Re: New strategies for freezing, advancing relfrozenxid early Re: New strategies for freezing, advancing relfrozenxid early |
Список | pgsql-hackers |
On Thu, Dec 22, 2022 at 11:39 AM Peter Geoghegan <pg@bowt.ie> wrote: > On Wed, Dec 21, 2022 at 4:53 PM Peter Geoghegan <pg@bowt.ie> wrote: > > Great. I plan on committing 0001 in the next few days. Committing 0002 > > might take a bit longer. > > I pushed the VACUUM cutoffs patch (previously 0001) this morning - > thanks for your help with that one. Attached is v12. I think that the page-level freezing patch is now commitable, and plan on committing it in the next 2-4 days barring any objections. Notable changes in v12: * Simplified some of the logic in FreezeMultiXactId(), which now doesn't have any needless handling of NewRelfrozenXid style cutoffs except in the one case that still needs it (its no-op processing case). We don't need most of the handling on HEAD anymore because every possible approach to processing a Multi other than FRM_NOOP will reliably leave behind a new xmax that is either InvalidTransactionId, or an XID/MXID >= OldestXmin/OldestMxact. Such values cannot possibly need to be tracked by the NewRelfrozenXid trackers, since the trackers are initialized using OldestXmin/OldestMxact to begin with. * v12 merges together the code for the "freeze the page" lazy_scan_prune path with the block that actually calls heap_freeze_execute_prepared(). This should make it clear that pagefrz.freeze_required really does mean that freezing is required. Hopefully that addresses Jeff's recent concern. It's certainly an improvement, in any case. * On a related note, comments around the same point in lazy_scan_prune as well as comments above the HeapPageFreeze struct now explain a concept I decided to call "nominal freezing". This is the case where we "freeze a page" without having any freeze plans to execute. "nominal freezing" is the new name for a concept I invented many months ago, which helps to resolve subtle problems with the way that heap_prepare_freeze_tuple is tasked with doing two different things for its lazy_scan_prune caller: 1. telling lazy_scan_prune how it would freeze each tuple (were it to freeze the page), and 2. helping lazy_scan_prune to determine if the page should become all-frozen in the VM. The latter is always conditioned on page-level freezing actually going ahead, since everything else in heap_prepare_freeze_tuple has to work that way. We always freeze a page with zero freeze plans (or "nominally freeze" the page) in lazy_scan_prune (which is nothing new in itself). We thereby avoid breaking heap_prepare_freeze_tuple's working assumption that all it needs to focus on what the page will look like after freezing executes, while also avoiding senselessly throwing away the ability to set a page all-frozen in the VM in lazy_scan_prune when it'll cost us nothing extra. That is, by always freezing in the event of zero freeze plans, we won't senselessly miss out on setting a page all-frozen in cases where we don't actually have to execute any freeze plans to make that safe, while the "freeze the page path versus don't freeze the page path" dichotomy still works as a high level conceptual abstraction. -- Peter Geoghegan
Вложения
В списке pgsql-hackers по дате отправления: