Content-Length: 322678 | pFad | http://github.com/postgrespro/postgres/commit/6daeeb1f9196e5d59aa7d5c9ef7ed67b3f3ac4b5

32 Avoid special XID snapshotConflictHorizon values. · postgrespro/postgres@6daeeb1 · GitHub
Skip to content

Commit 6daeeb1

Browse files
Avoid special XID snapshotConflictHorizon values.
Don't allow VACUUM to WAL-log the value FrozenTransactionId as the snapshotConflictHorizon of freezing or visibility map related WAL records. The only special XID value that's an allowable snapshotConflictHorizon is InvalidTransactionId, which is interpreted as "record definitely doesn't require a recovery conflict". Author: Peter Geoghegan <pg@bowt.ie> Discussion: https://postgr.es/m/CAH2-WznuNGSzF8v6OsgjaC5aYsb3cZ6HW6MLm30X0d65cmSH6A@mail.gmail.com
1 parent 1fd3dd2 commit 6daeeb1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/backend/access/heap/vacuumlazy.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,7 +1698,8 @@ lazy_scan_prune(LVRelState *vacrel,
16981698
}
16991699

17001700
/* Track newest xmin on page. */
1701-
if (TransactionIdFollows(xmin, prunestate->visibility_cutoff_xid))
1701+
if (TransactionIdFollows(xmin, prunestate->visibility_cutoff_xid) &&
1702+
TransactionIdIsNormal(xmin))
17021703
prunestate->visibility_cutoff_xid = xmin;
17031704
}
17041705
break;
@@ -1863,7 +1864,7 @@ lazy_scan_prune(LVRelState *vacrel,
18631864
* because visibility_cutoff_xid will be logged by our caller in a
18641865
* moment.
18651866
*/
1866-
Assert(cutoff == FrozenTransactionId ||
1867+
Assert(!TransactionIdIsValid(cutoff) ||
18671868
cutoff == prunestate->visibility_cutoff_xid);
18681869
}
18691870
#endif
@@ -3293,7 +3294,8 @@ heap_page_is_all_visible(LVRelState *vacrel, Buffer buf,
32933294
}
32943295

32953296
/* Track newest xmin on page. */
3296-
if (TransactionIdFollows(xmin, *visibility_cutoff_xid))
3297+
if (TransactionIdFollows(xmin, *visibility_cutoff_xid) &&
3298+
TransactionIdIsNormal(xmin))
32973299
*visibility_cutoff_xid = xmin;
32983300

32993301
/* Check whether this tuple is already frozen or not */

src/backend/storage/ipc/standby.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ ResolveRecoveryConflictWithSnapshot(TransactionId snapshotConflictHorizon,
493493
if (!TransactionIdIsValid(snapshotConflictHorizon))
494494
return;
495495

496+
Assert(TransactionIdIsNormal(snapshotConflictHorizon));
496497
backends = GetConflictingVirtualXIDs(snapshotConflictHorizon,
497498
locator.dbOid);
498499
ResolveRecoveryConflictWithVirtualXIDs(backends,

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/6daeeb1f9196e5d59aa7d5c9ef7ed67b3f3ac4b5

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy