Skip to content

Commit 895267a

Browse files
Remove unneeded nbtree latestRemovedXid comments.
Discussing the low level issue of nbtree VACUUM and recovery conflicts in btvacuumpage() now seems inappropriate. The same issue is discussed in nbtxlog.h, as well as in a comment block above _bt_delitems_vacuum(). The comment block made more sense when it was part of a broader discussion of nbtree VACUUM "pin scans". These were removed by commit 9f83468.
1 parent e6a7600 commit 895267a

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

src/backend/access/nbtree/nbtree.c

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,12 +1183,6 @@ btvacuumpage(BTVacState *vstate, BlockNumber scanblkno)
11831183
opaque->btpo_next < scanblkno)
11841184
backtrack_to = opaque->btpo_next;
11851185

1186-
/*
1187-
* When each VACUUM begins, it determines an OldestXmin cutoff value.
1188-
* Tuples before the cutoff are removed by VACUUM. Scan over all
1189-
* items to see which ones need to be deleted according to cutoff
1190-
* point using callback.
1191-
*/
11921186
ndeletable = 0;
11931187
nupdatable = 0;
11941188
minoff = P_FIRSTDATAKEY(opaque);
@@ -1197,6 +1191,7 @@ btvacuumpage(BTVacState *vstate, BlockNumber scanblkno)
11971191
nhtidslive = 0;
11981192
if (callback)
11991193
{
1194+
/* btbulkdelete callback tells us what to delete (or update) */
12001195
for (offnum = minoff;
12011196
offnum <= maxoff;
12021197
offnum = OffsetNumberNext(offnum))
@@ -1206,26 +1201,6 @@ btvacuumpage(BTVacState *vstate, BlockNumber scanblkno)
12061201
itup = (IndexTuple) PageGetItem(page,
12071202
PageGetItemId(page, offnum));
12081203

1209-
/*
1210-
* Hot Standby assumes that it's okay that XLOG_BTREE_VACUUM
1211-
* records do not produce their own conflicts. This is safe
1212-
* as long as the callback function only considers whether the
1213-
* index tuple refers to pre-cutoff heap tuples that were
1214-
* certainly already pruned away during VACUUM's initial heap
1215-
* scan by the time we get here. (heapam's XLOG_HEAP2_PRUNE
1216-
* records produce conflicts using a latestRemovedXid value
1217-
* for the pointed-to heap tuples, so there is no need to
1218-
* produce our own conflict now.)
1219-
*
1220-
* Backends with snapshots acquired after a VACUUM starts but
1221-
* before it finishes could have visibility cutoff with a
1222-
* later xid than VACUUM's OldestXmin cutoff. These backends
1223-
* might happen to opportunistically mark some index tuples
1224-
* LP_DEAD before we reach them, even though they may be after
1225-
* our cutoff. We don't try to kill these "extra" index
1226-
* tuples in _bt_delitems_vacuum(). This keep things simple,
1227-
* and allows us to always avoid generating our own conflicts.
1228-
*/
12291204
Assert(!BTreeTupleIsPivot(itup));
12301205
if (!BTreeTupleIsPosting(itup))
12311206
{

0 commit comments

Comments
 (0)