On Mon, Jun 19, 2023 at 2:29 PM Thomas Munro <thomas.munro@gmail.com> wrote:
> S2: _bt_search(&buf)
> S1: INSERT ...
> S2: PredicateLockRelation(...);
> My point is that S2 won't ever scan S1's tuples, so it won't pass S1's
> xid to CheckForSerializableConflictOut()
[completing that sentence a little more] ... so this was our only
chance to detect that S2 read an object that S1 wrote. But the
_bt_search() and PredicateLockXXX() calls are not atomic and not
rechecked, so a write between them is invisible to the algorithm. I'm
not sure about this, but it's the idea I'm exploring...