Re: Why clearing the VM doesn't require registering vm buffer in wal record - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: Why clearing the VM doesn't require registering vm buffer in wal record
Date
Msg-id c3c150b1-3100-4ebe-910d-ef51a37d046d@vondra.me
Whole thread
In response to Re: Why clearing the VM doesn't require registering vm buffer in wal record  (Melanie Plageman <melanieplageman@gmail.com>)
List pgsql-hackers

On 5/6/26 23:46, Melanie Plageman wrote:
> Thanks for the review! I incorporated all your suggestions in attached
> v2 unless otherwise noted below.
> 
> Based on an LLM-assisted self-review of this code, I think there is a
> pre-existing bug in heap_lock_updated_tuple_rec() where we don't reset
> cleared_all_frozen and may have a stale value if we iterate more than
> once (new tuple versions) or use the l4 goto label (retries for the
> same tuple version). This could mean we unnecessarily clear all-frozen
> on the standby (and unnecessarily register the VM buffer after my
> patch). I couldn't come up with a repro though, so I didn't include a
> patch to fix it, as I wanted to confirm that someone else also thought
> this is a bug.
> 

Hmm, would this be a correctness or efficiency issue?

I'm not very familiar with this code, so I can't say if there is an
issue or not. Could you explain the sequence of steps leading to an
issue? Maybe that assumes something that's not quite possible, or it
might help constructing a reproducer.

I don't quite see how could it be related to the "l4" goto label, when
all the "goto l4" cases are before setting "cleared_all_frozen = true"
(in any given iteration).


regards

-- 
Tomas Vondra




pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Broken build on macOS (Universal / Intel): cpuid instruction not available
Next
From: Laurenz Albe
Date:
Subject: Re: Wrong results with equality search using trigram index and non-deterministic collation