aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2020-08-18 16:31:12 -0700
committerAndres Freund <andres@anarazel.de>2020-08-18 16:31:12 -0700
commit07f32fcd23ac81898ed47f88beb569c631a2f223 (patch)
tree937eaa5046a53f1e5960f43783e9c4ea6723b2b2 /doc/src
parent734478200ababcbb328ec3f02a74047bc470cae2 (diff)
downloadpostgresql-07f32fcd23ac81898ed47f88beb569c631a2f223.tar.gz
postgresql-07f32fcd23ac81898ed47f88beb569c631a2f223.zip
Fix race condition in snapshot caching when 2PC is used.
When preparing a transaction xactCompletionCount needs to be incremented, even though the transaction has not committed yet. Otherwise the snapshot used within the transaction otherwise can get reused outside of the prepared transaction. As GetSnapshotData() does not include the current xid when building a snapshot, reuse would not be correct. Somewhat surprisingly the regression tests only rarely show incorrect results without the fix. The reason for that is that often the snapshot's xmax will be >= the backend xid, yielding a snapshot that is correct, despite the bug. I'm working on a reliable test for the bug, but it seems worth seeing whether this fixes all the BF failures while I do. Author: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/E1k7tGP-0005V0-5k@gemulon.postgresql.org
Diffstat (limited to 'doc/src')
0 files changed, 0 insertions, 0 deletions