Re: [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple

Alvaro Herrera <alvherre@alvh.no-ip.org>

From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: "Wood, Dan" <hexpert@amazon.com>
Cc: Peter Geoghegan <pg@bowt.ie>, Michael Paquier <michael.paquier@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, "Wong, Yi Wen" <yiwong@amazon.com>
Date: 2017-10-04T09:54:29Z
Lists: pgsql-hackers
Wood, Dan wrote:
> One minor side note…   Is it weird for xmin/xmax to go backwards in a hot row chain?
> 
> lp | t_ctid | lp_off | t_infomask | t_infomask2 | t_xmin | t_xmax 
> ----+--------+--------+------------+-------------+--------+--------
>   1 | (0,1)  |   8152 |       2818 |           3 |  36957 |      0
>   2 |        |      5 |            |             |        |       
>   3 |        |      0 |            |             |        |       
>   4 |        |      0 |            |             |        |       
>   5 | (0,6)  |   8112 |       9986 |       49155 |  36962 |  36963
>   6 | (0,7)  |   8072 |       9986 |       49155 |  36963 |  36961
>   7 | (0,7)  |   8032 |      11010 |       32771 |  36961 |      0
> (7 rows)

No, it just means transaction A got its XID before transaction B, but B
executed the update first and A updated the tuple second.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Commits

  1. Backport addition of rs_old_rel to rewriteheap's state.

  2. Perform a lot more sanity checks when freezing tuples.

  3. Revert bogus fixes of HOT-freezing bug

  4. Fix traversal of half-frozen update chains

  5. Fix freezing of a dead HOT-updated tuple

  6. During index build, check and elog (not just Assert) for broken HOT chain.

  7. Fix WAL replay of locking an updated tuple

  8. Change the way we mark tuples as frozen.