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