forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit996d273
committed
Avoid consuming an XID during vac_truncate_clog().
vac_truncate_clog() uses its own transaction ID as the comparison point ina sanity check that no database's datfrozenxid has already wrapped around"into the future". That was probably fine when written, but in a lazyvacuum we won't have assigned an XID, so calling GetCurrentTransactionId()causes an XID to be assigned when otherwise one would not be. Most of thetime that's not a big problem ... but if we are hard up against thewraparound limit, consuming XIDs during antiwraparound vacuums is a verybad thing.Instead, use ReadNewTransactionId(), which not only avoids this problembut is in itself a better comparison point to test whether wraparoundhas already occurred.Report and patch by Alexander Korotkov. Back-patch to all versions.Report: <CAPpHfdspOkmiQsxh-UZw2chM6dRMwXAJGEmmbmqYR=yvM7-s6A@mail.gmail.com>1 parent0c7cd45 commit996d273
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1051 | 1051 |
| |
1052 | 1052 |
| |
1053 | 1053 |
| |
1054 |
| - | |
| 1054 | + | |
1055 | 1055 |
| |
1056 | 1056 |
| |
1057 | 1057 |
| |
| |||
1100 | 1100 |
| |
1101 | 1101 |
| |
1102 | 1102 |
| |
1103 |
| - | |
| 1103 | + | |
1104 | 1104 |
| |
1105 | 1105 |
| |
1106 | 1106 |
| |
|
0 commit comments
Comments
(0)