forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit90c885c
committed
Increment xactCompletionCount during subtransaction abort.
Snapshot caching, introduced in623a9ba, did not incrementxactCompletionCount during subtransaction abort. That could lead to an oldersnapshot being reused. That is, at least as far as I can see, not acorrectness issue (for MVCC snapshots there's no difference between "inprogress" and "aborted"). The only difference between the old and newsnapshots would be a newer ->xmax.While HeapTupleSatisfiesMVCC makes the same visibility determination, reusingthe old snapshot leads HeapTupleSatisfiesMVCC to not setHEAP_XMIN_INVALID. Which subsequently causes the kill_prior_tuple optimizationto not kick in (via HeapTupleIsSurelyDead() returning false). The performanceeffects of doing the same index-lookups over and over again is how the issuewas discovered...Fix the issue by incrementing xactCompletionCount inXidCacheRemoveRunningXids. It already acquires ProcArrayLock exclusively,making that an easy proposition.Add a test to ensure that kill_prior_tuple prevents index growth when itinvolves aborted subtransaction of the current transaction.Author: Andres FreundDiscussion:https://postgr.es/m/20210406043521.lopeo7bbigad3n6t@alap3.anarazel.deDiscussion:https://postgr.es/m/20210317055718.v6qs3ltzrformqoa%40alap3.anarazel.de1 parent8523492 commit90c885c
File tree
5 files changed
+96
-1
lines changed- src
- backend/storage/ipc
- test/regress
- expected
- sql
5 files changed
+96
-1
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1210 | 1210 |
| |
1211 | 1211 |
| |
1212 | 1212 |
| |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
1213 | 1218 |
| |
1214 | 1219 |
| |
1215 | 1220 |
| |
| |||
3915 | 3920 |
| |
3916 | 3921 |
| |
3917 | 3922 |
| |
| 3923 | + | |
| 3924 | + | |
| 3925 | + | |
3918 | 3926 |
| |
3919 | 3927 |
| |
3920 | 3928 |
| |
|
Lines changed: 42 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + |
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
32 |
| - | |
| 32 | + | |
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| 14 | + | |
14 | 15 |
| |
15 | 16 |
| |
16 | 17 |
| |
|
Lines changed: 44 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + |
0 commit comments
Comments
(0)