Re: POC: Lock updated tuples in tuple_update() and tuple_delete()

Aleksander Alekseev <aleksander@timescale.com>

From: Aleksander Alekseev <aleksander@timescale.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Alexander Korotkov <aekorotkov@gmail.com>
Date: 2022-07-05T13:41:27Z
Lists: pgsql-hackers
Hi again,

> +        if (!updated)
> +        {
> +            /* Should not encounter speculative tuple on recheck */
> +            Assert(!HeapTupleHeaderIsSpeculative(tuple->t_data));
> -             ReleaseBuffer(buffer);
> +            ReleaseBuffer(buffer);
> +        }
> +        else
> +        {
> +            updated = false;
> +        }

OK, I got confused here. I suggest changing the if(!...) { .. } else {
.. } code to if() { .. } else { .. } here.

-- 
Best regards,
Aleksander Alekseev



Commits

  1. Add EvalPlanQual delete returning isolation test

  2. Allow locking updated tuples in tuple_update() and tuple_delete()

  3. Revert 764da7710b

  4. Revert 11470f544e

  5. Evade extra table_tuple_fetch_row_version() in ExecUpdate()/ExecDelete()

  6. Check that xmax didn't commit in freeze check.