]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Use TransactionXmin instead of RecentGlobalXmin in heap_abort_speculative().
authorAndres Freund <andres@anarazel.de>
Mon, 6 Apr 2020 00:47:30 +0000 (17:47 -0700)
committerAndres Freund <andres@anarazel.de>
Mon, 6 Apr 2020 00:48:35 +0000 (17:48 -0700)
commit0e708d3115958ffcd8e91123f405dc482871abf6
tree86c893a57acac6f0488177373d05aafd2395d4f5
parent038c9bbe9b6193cf8eeea3f7485134ef17fd947b
Use TransactionXmin instead of RecentGlobalXmin in heap_abort_speculative().

There's a very low risk that RecentGlobalXmin could be far enough in
the past to be older than relfrozenxid, or even wrapped
around. Luckily the consequences of that having happened wouldn't be
too bad - the page wouldn't be pruned for a while.

Avoid that risk by using TransactionXmin instead. As that's announced
via MyPgXact->xmin, it is protected against wrapping around (see code
comments for details around relfrozenxid).

Author: Andres Freund
Discussion: https://postgr.es/m/20200328213023.s4eyijhdosuc4vcj@alap3.anarazel.de
Backpatch: 9.5-
src/backend/access/heap/heapam.c