Skip to content

Commit f6e0927

Browse files
Only send cleanup_info messages if VACUUM removes any tuples.
There is no other purpose for this message type than to report the latestRemovedXid of removed tuples, prior to index scans. Removes overlooked path for sending invalid latestRemovedXid. Fixes buildfarm failure on centaur.
1 parent 0192abc commit f6e0927

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/backend/commands/vacuumlazy.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*
3030
*
3131
* IDENTIFICATION
32-
* $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.133 2010/04/21 17:20:56 sriggs Exp $
32+
* $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.134 2010/04/21 19:53:24 sriggs Exp $
3333
*
3434
*-------------------------------------------------------------------------
3535
*/
@@ -274,9 +274,12 @@ vacuum_log_cleanup_info(Relation rel, LVRelStats *vacrelstats)
274274
if (rel->rd_istemp || !XLogIsNeeded())
275275
return;
276276

277-
Assert(TransactionIdIsValid(vacrelstats->latestRemovedXid));
277+
if (vacrelstats->tuples_deleted > 0)
278+
{
279+
Assert(TransactionIdIsValid(vacrelstats->latestRemovedXid));
278280

279-
(void) log_heap_cleanup_info(rel->rd_node, vacrelstats->latestRemovedXid);
281+
(void) log_heap_cleanup_info(rel->rd_node, vacrelstats->latestRemovedXid);
282+
}
280283
}
281284

282285
/*

0 commit comments

Comments
 (0)