Fix comment, add Assert.

This commit is contained in:
Tom Lane 2001-09-04 19:12:05 +00:00
parent bc1a61a30d
commit 936114a019
2 changed files with 13 additions and 6 deletions

View File

@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.208 2001/08/26 16:55:59 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.209 2001/09/04 19:12:05 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1069,8 +1069,8 @@ scan_heap(VRelStats *vacrelstats, Relation onerel,
FreezeLimit))
{
tuple.t_data->t_xmin = FrozenTransactionId;
tuple.t_data->t_infomask &= ~HEAP_XMIN_INVALID;
tuple.t_data->t_infomask |= HEAP_XMIN_COMMITTED;
/* infomask should be okay already */
Assert(tuple.t_data->t_infomask & HEAP_XMIN_COMMITTED);
pgchanged = true;
}
break;

View File

@ -31,7 +31,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuumlazy.c,v 1.5 2001/08/26 16:55:59 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuumlazy.c,v 1.6 2001/09/04 19:12:05 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -318,14 +318,21 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
/*
* Tuple is good. Consider whether to replace its xmin
* value with FrozenTransactionId.
*
* NB: Since we hold only a shared buffer lock here,
* we are assuming that TransactionId read/write
* is atomic. This is not the only place that makes
* such an assumption. It'd be possible to avoid the
* assumption by momentarily acquiring exclusive lock,
* but for the moment I see no need to.
*/
if (TransactionIdIsNormal(tuple.t_data->t_xmin) &&
TransactionIdPrecedes(tuple.t_data->t_xmin,
FreezeLimit))
{
tuple.t_data->t_xmin = FrozenTransactionId;
tuple.t_data->t_infomask &= ~HEAP_XMIN_INVALID;
tuple.t_data->t_infomask |= HEAP_XMIN_COMMITTED;
/* infomask should be okay already */
Assert(tuple.t_data->t_infomask & HEAP_XMIN_COMMITTED);
pgchanged = true;
}
break;