Commit 936114a0 authored by Tom Lane's avatar Tom Lane

Fix comment, add Assert.

parent bc1a61a3
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* *
* *
* IDENTIFICATION * 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, ...@@ -1069,8 +1069,8 @@ scan_heap(VRelStats *vacrelstats, Relation onerel,
FreezeLimit)) FreezeLimit))
{ {
tuple.t_data->t_xmin = FrozenTransactionId; tuple.t_data->t_xmin = FrozenTransactionId;
tuple.t_data->t_infomask &= ~HEAP_XMIN_INVALID; /* infomask should be okay already */
tuple.t_data->t_infomask |= HEAP_XMIN_COMMITTED; Assert(tuple.t_data->t_infomask & HEAP_XMIN_COMMITTED);
pgchanged = true; pgchanged = true;
} }
break; break;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* *
* *
* IDENTIFICATION * 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, ...@@ -318,14 +318,21 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
/* /*
* Tuple is good. Consider whether to replace its xmin * Tuple is good. Consider whether to replace its xmin
* value with FrozenTransactionId. * 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) && if (TransactionIdIsNormal(tuple.t_data->t_xmin) &&
TransactionIdPrecedes(tuple.t_data->t_xmin, TransactionIdPrecedes(tuple.t_data->t_xmin,
FreezeLimit)) FreezeLimit))
{ {
tuple.t_data->t_xmin = FrozenTransactionId; tuple.t_data->t_xmin = FrozenTransactionId;
tuple.t_data->t_infomask &= ~HEAP_XMIN_INVALID; /* infomask should be okay already */
tuple.t_data->t_infomask |= HEAP_XMIN_COMMITTED; Assert(tuple.t_data->t_infomask & HEAP_XMIN_COMMITTED);
pgchanged = true; pgchanged = true;
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment