Hi, On 2026-03-05 21:23:12 +0100, Matthias van de Meent wrote: > On Thu, 5 Mar 2026 at 20:56, Melanie Plageman <[email protected]> > wrote: > > > > Today Andres and I noticed that heap_{update,insert,delete}() don't > > register the VM buffer when they are clearing the VM. I was under the > > impression that any buffers modified needed to be registered in the > > WAL record. Without which, you'll never do an FPI. It seems like this > > could cause checksum failures. What are we missing? > > Might it be, because zeroing a VM page (which you would do when you > encounter checksum failures) is an MVCC-safe operation?
We are afaict not automatically zeroing corrupted VM pages (we are doing that for FSM though). IMO it's a bug if a user ever has to turn on zero_damaged_pages outside of the storage actually corrupting data. > I agree with you that we probably _should_ register the VM (and possibly > FSM) buffer, but that's a bit of a different story. Right now, the VM does > not use the standard page format (nor does the FSM), and therefore every FPI > would be the full 8KB, even when just a few bits of the VM page are in use; > which would be a rather large waste of space. If checksums are enabled, we are already emitting FPIs for the VM when *setting* bits in the VM (c.f. log_heap_visible()). I don't see why the story for clearing it should be different. And because there are so few VM pages compared to heap pages, I wouldn't expect there to be a meaningful amount of VM FPIs outside of very contrived workloads. > On Thu, 5 Mar 2026 at 21:16, Andres Freund <[email protected]> wrote: > > > > But it does seem like it could be a problem for incremental backup / > > walsummarizer? > > I don't think it is, because that doesn't do calculations for non-main > forks, it considers those forks always changed and includes them in > full. Or at least, that was the response I got when I raised concerns > about the FSM back when the incremental backup feature was being > developed [0]. There's explicit code for ignoring the FSM, but I don't see the same for the VM. And that makes sense: VM changes are mostly WAL logged, just not completely / generically (i.e. this complaint), whereas FSM changes are not WAL logged at all. Greetings, Andres Freund
