Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit dfc9028

Browse files
committed
Add C comments that HEAP_MOVED_* define usage is only for pre-9.0 binary
upgrades.
1 parent 3ab41f0 commit dfc9028

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

src/backend/utils/time/tqual.c

+16-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* Portions Copyright (c) 1994, Regents of the University of California
5151
*
5252
* IDENTIFICATION
53-
* $PostgreSQL: pgsql/src/backend/utils/time/tqual.c,v 1.116 2010/02/08 04:33:54 tgl Exp $
53+
* $PostgreSQL: pgsql/src/backend/utils/time/tqual.c,v 1.117 2010/02/08 14:10:21 momjian Exp $
5454
*
5555
*-------------------------------------------------------------------------
5656
*/
@@ -91,7 +91,7 @@ static bool XidInMVCCSnapshot(TransactionId xid, Snapshot snapshot);
9191
* code in heapam.c relies on that!)
9292
*
9393
* Also, if we are cleaning up HEAP_MOVED_IN or HEAP_MOVED_OFF entries, then
94-
* we can always set the hint bits, since old-style VACUUM FULL always used
94+
* we can always set the hint bits, since pre-9.0 VACUUM FULL always used
9595
* synchronous commits and didn't move tuples that weren't previously
9696
* hinted. (This is not known by this subroutine, but is applied by its
9797
* callers.) Note: old-style VACUUM FULL is gone, but we have to keep this
@@ -167,6 +167,7 @@ HeapTupleSatisfiesSelf(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer)
167167
if (tuple->t_infomask & HEAP_XMIN_INVALID)
168168
return false;
169169

170+
/* Used by pre-9.0 binary upgrades */
170171
if (tuple->t_infomask & HEAP_MOVED_OFF)
171172
{
172173
TransactionId xvac = HeapTupleHeaderGetXvac(tuple);
@@ -185,6 +186,7 @@ HeapTupleSatisfiesSelf(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer)
185186
InvalidTransactionId);
186187
}
187188
}
189+
/* Used by pre-9.0 binary upgrades */
188190
else if (tuple->t_infomask & HEAP_MOVED_IN)
189191
{
190192
TransactionId xvac = HeapTupleHeaderGetXvac(tuple);
@@ -338,6 +340,7 @@ HeapTupleSatisfiesNow(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer)
338340
if (tuple->t_infomask & HEAP_XMIN_INVALID)
339341
return false;
340342

343+
/* Used by pre-9.0 binary upgrades */
341344
if (tuple->t_infomask & HEAP_MOVED_OFF)
342345
{
343346
TransactionId xvac = HeapTupleHeaderGetXvac(tuple);
@@ -356,6 +359,7 @@ HeapTupleSatisfiesNow(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer)
356359
InvalidTransactionId);
357360
}
358361
}
362+
/* Used by pre-9.0 binary upgrades */
359363
else if (tuple->t_infomask & HEAP_MOVED_IN)
360364
{
361365
TransactionId xvac = HeapTupleHeaderGetXvac(tuple);
@@ -502,6 +506,7 @@ HeapTupleSatisfiesToast(HeapTupleHeader tuple, Snapshot snapshot,
502506
if (tuple->t_infomask & HEAP_XMIN_INVALID)
503507
return false;
504508

509+
/* Used by pre-9.0 binary upgrades */
505510
if (tuple->t_infomask & HEAP_MOVED_OFF)
506511
{
507512
TransactionId xvac = HeapTupleHeaderGetXvac(tuple);
@@ -520,6 +525,7 @@ HeapTupleSatisfiesToast(HeapTupleHeader tuple, Snapshot snapshot,
520525
InvalidTransactionId);
521526
}
522527
}
528+
/* Used by pre-9.0 binary upgrades */
523529
else if (tuple->t_infomask & HEAP_MOVED_IN)
524530
{
525531
TransactionId xvac = HeapTupleHeaderGetXvac(tuple);
@@ -581,6 +587,7 @@ HeapTupleSatisfiesUpdate(HeapTupleHeader tuple, CommandId curcid,
581587
if (tuple->t_infomask & HEAP_XMIN_INVALID)
582588
return HeapTupleInvisible;
583589

590+
/* Used by pre-9.0 binary upgrades */
584591
if (tuple->t_infomask & HEAP_MOVED_OFF)
585592
{
586593
TransactionId xvac = HeapTupleHeaderGetXvac(tuple);
@@ -599,6 +606,7 @@ HeapTupleSatisfiesUpdate(HeapTupleHeader tuple, CommandId curcid,
599606
InvalidTransactionId);
600607
}
601608
}
609+
/* Used by pre-9.0 binary upgrades */
602610
else if (tuple->t_infomask & HEAP_MOVED_IN)
603611
{
604612
TransactionId xvac = HeapTupleHeaderGetXvac(tuple);
@@ -748,6 +756,7 @@ HeapTupleSatisfiesDirty(HeapTupleHeader tuple, Snapshot snapshot,
748756
if (tuple->t_infomask & HEAP_XMIN_INVALID)
749757
return false;
750758

759+
/* Used by pre-9.0 binary upgrades */
751760
if (tuple->t_infomask & HEAP_MOVED_OFF)
752761
{
753762
TransactionId xvac = HeapTupleHeaderGetXvac(tuple);
@@ -766,6 +775,7 @@ HeapTupleSatisfiesDirty(HeapTupleHeader tuple, Snapshot snapshot,
766775
InvalidTransactionId);
767776
}
768777
}
778+
/* Used by pre-9.0 binary upgrades */
769779
else if (tuple->t_infomask & HEAP_MOVED_IN)
770780
{
771781
TransactionId xvac = HeapTupleHeaderGetXvac(tuple);
@@ -907,6 +917,7 @@ HeapTupleSatisfiesMVCC(HeapTupleHeader tuple, Snapshot snapshot,
907917
if (tuple->t_infomask & HEAP_XMIN_INVALID)
908918
return false;
909919

920+
/* Used by pre-9.0 binary upgrades */
910921
if (tuple->t_infomask & HEAP_MOVED_OFF)
911922
{
912923
TransactionId xvac = HeapTupleHeaderGetXvac(tuple);
@@ -925,6 +936,7 @@ HeapTupleSatisfiesMVCC(HeapTupleHeader tuple, Snapshot snapshot,
925936
InvalidTransactionId);
926937
}
927938
}
939+
/* Used by pre-9.0 binary upgrades */
928940
else if (tuple->t_infomask & HEAP_MOVED_IN)
929941
{
930942
TransactionId xvac = HeapTupleHeaderGetXvac(tuple);
@@ -1066,6 +1078,7 @@ HeapTupleSatisfiesVacuum(HeapTupleHeader tuple, TransactionId OldestXmin,
10661078
{
10671079
if (tuple->t_infomask & HEAP_XMIN_INVALID)
10681080
return HEAPTUPLE_DEAD;
1081+
/* Used by pre-9.0 binary upgrades */
10691082
else if (tuple->t_infomask & HEAP_MOVED_OFF)
10701083
{
10711084
TransactionId xvac = HeapTupleHeaderGetXvac(tuple);
@@ -1083,6 +1096,7 @@ HeapTupleSatisfiesVacuum(HeapTupleHeader tuple, TransactionId OldestXmin,
10831096
SetHintBits(tuple, buffer, HEAP_XMIN_COMMITTED,
10841097
InvalidTransactionId);
10851098
}
1099+
/* Used by pre-9.0 binary upgrades */
10861100
else if (tuple->t_infomask & HEAP_MOVED_IN)
10871101
{
10881102
TransactionId xvac = HeapTupleHeaderGetXvac(tuple);

src/include/access/htup.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/access/htup.h,v 1.111 2010/02/08 04:33:54 tgl Exp $
10+
* $PostgreSQL: pgsql/src/include/access/htup.h,v 1.112 2010/02/08 14:10:21 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -176,9 +176,11 @@ typedef HeapTupleHeaderData *HeapTupleHeader;
176176
#define HEAP_XMAX_IS_MULTI 0x1000 /* t_xmax is a MultiXactId */
177177
#define HEAP_UPDATED 0x2000 /* this is UPDATEd version of row */
178178
#define HEAP_MOVED_OFF 0x4000 /* moved to another place by
179-
* old-style VACUUM FULL */
179+
* pre-9.0 VACUUM FULL; kept
180+
* for binary upgrade support */
180181
#define HEAP_MOVED_IN 0x8000 /* moved from another place by
181-
* old-style VACUUM FULL */
182+
* pre-9.0 VACUUM FULL; kept
183+
* for binary upgrade support */
182184
#define HEAP_MOVED (HEAP_MOVED_OFF | HEAP_MOVED_IN)
183185

184186
#define HEAP_XACT_MASK 0xFFE0 /* visibility-related bits */

0 commit comments

Comments
 (0)