mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-07 19:47:50 +08:00
Continue to allow VACUUM to mark last block of index dirty
even when there is no work to do. Further analysis required.
Revert of patch c1458cc495
This commit is contained in:
parent
a4ffcc8e11
commit
2d2841a56c
@ -732,7 +732,7 @@ _bt_page_recyclable(Page page)
|
||||
* and so must be scanned anyway during replay. We always write a WAL record
|
||||
* for the last block in the index, whether or not it contained any items
|
||||
* to be removed. This allows us to scan right up to end of index to
|
||||
* ensure correct locking. That is the only time we are called with nitems==0.
|
||||
* ensure correct locking.
|
||||
*/
|
||||
void
|
||||
_bt_delitems_vacuum(Relation rel, Buffer buf,
|
||||
@ -764,8 +764,7 @@ _bt_delitems_vacuum(Relation rel, Buffer buf,
|
||||
*/
|
||||
opaque->btpo_flags &= ~BTP_HAS_GARBAGE;
|
||||
|
||||
if (nitems > 0)
|
||||
MarkBufferDirty(buf);
|
||||
MarkBufferDirty(buf);
|
||||
|
||||
/* XLOG stuff */
|
||||
if (RelationNeedsWAL(rel))
|
||||
@ -805,11 +804,8 @@ _bt_delitems_vacuum(Relation rel, Buffer buf,
|
||||
|
||||
recptr = XLogInsert(RM_BTREE_ID, XLOG_BTREE_VACUUM, rdata);
|
||||
|
||||
if (nitems > 0)
|
||||
{
|
||||
PageSetLSN(page, recptr);
|
||||
PageSetTLI(page, ThisTimeLineID);
|
||||
}
|
||||
PageSetLSN(page, recptr);
|
||||
PageSetTLI(page, ThisTimeLineID);
|
||||
}
|
||||
|
||||
END_CRIT_SECTION();
|
||||
|
Loading…
Reference in New Issue
Block a user