@@ -254,10 +254,10 @@ typedef struct SERIALIZABLEXID
254
254
* be the target of predicate locks.
255
255
*
256
256
* Note that the hash function being used doesn't properly respect tag
257
- * length -- it will go to a four byte boundary past the end of the tag.
258
- * If you change this struct, make sure any slack space is initialized,
259
- * so that any random bytes in the middle or at the end are not included
260
- * in the hash.
257
+ * length -- if the length of the structure isn't a multiple of four bytes it
258
+ * will go to a four byte boundary past the end of the tag. If you change
259
+ * this struct, make sure any slack space is initialized, so that any random
260
+ * bytes in the middle or at the end are not included in the hash.
261
261
*
262
262
* TODO SSI: If we always use the same fields for the same type of value, we
263
263
* should rename these. Holding off until it's clear there are no exceptions.
@@ -272,7 +272,6 @@ typedef struct PREDICATELOCKTARGETTAG
272
272
uint32 locktag_field2 ; /* a 32-bit ID field */
273
273
uint32 locktag_field3 ; /* a 32-bit ID field */
274
274
uint32 locktag_field4 ; /* a 32-bit ID field */
275
- uint32 locktag_field5 ; /* a 32-bit ID field */
276
275
} PREDICATELOCKTARGETTAG ;
277
276
278
277
/*
@@ -283,12 +282,6 @@ typedef struct PREDICATELOCKTARGETTAG
283
282
* added when a predicate lock is requested on an object which doesn't
284
283
* already have one. An entry is removed when the last lock is removed from
285
284
* its list.
286
- *
287
- * Because a particular target might become obsolete, due to update to a new
288
- * version, before the reading transaction is obsolete, we need some way to
289
- * prevent errors from reuse of a tuple ID. Rather than attempting to clean
290
- * up the targets as the related tuples are pruned or vacuumed, we check the
291
- * xmin on access. This should be far less costly.
292
285
*/
293
286
typedef struct PREDICATELOCKTARGET
294
287
{
@@ -398,22 +391,19 @@ typedef struct PredicateLockData
398
391
((locktag).locktag_field1 = (dboid), \
399
392
(locktag).locktag_field2 = (reloid), \
400
393
(locktag).locktag_field3 = InvalidBlockNumber, \
401
- (locktag).locktag_field4 = InvalidOffsetNumber, \
402
- (locktag).locktag_field5 = InvalidTransactionId)
394
+ (locktag).locktag_field4 = InvalidOffsetNumber)
403
395
404
396
#define SET_PREDICATELOCKTARGETTAG_PAGE (locktag ,dboid ,reloid ,blocknum ) \
405
397
((locktag).locktag_field1 = (dboid), \
406
398
(locktag).locktag_field2 = (reloid), \
407
399
(locktag).locktag_field3 = (blocknum), \
408
- (locktag).locktag_field4 = InvalidOffsetNumber, \
409
- (locktag).locktag_field5 = InvalidTransactionId)
400
+ (locktag).locktag_field4 = InvalidOffsetNumber)
410
401
411
- #define SET_PREDICATELOCKTARGETTAG_TUPLE (locktag ,dboid ,reloid ,blocknum ,offnum , xmin ) \
402
+ #define SET_PREDICATELOCKTARGETTAG_TUPLE (locktag ,dboid ,reloid ,blocknum ,offnum ) \
412
403
((locktag).locktag_field1 = (dboid), \
413
404
(locktag).locktag_field2 = (reloid), \
414
405
(locktag).locktag_field3 = (blocknum), \
415
- (locktag).locktag_field4 = (offnum), \
416
- (locktag).locktag_field5 = (xmin))
406
+ (locktag).locktag_field4 = (offnum))
417
407
418
408
#define GET_PREDICATELOCKTARGETTAG_DB (locktag ) \
419
409
((Oid) (locktag).locktag_field1)
@@ -423,8 +413,6 @@ typedef struct PredicateLockData
423
413
((BlockNumber) (locktag).locktag_field3)
424
414
#define GET_PREDICATELOCKTARGETTAG_OFFSET (locktag ) \
425
415
((OffsetNumber) (locktag).locktag_field4)
426
- #define GET_PREDICATELOCKTARGETTAG_XMIN (locktag ) \
427
- ((TransactionId) (locktag).locktag_field5)
428
416
#define GET_PREDICATELOCKTARGETTAG_TYPE (locktag ) \
429
417
(((locktag).locktag_field4 != InvalidOffsetNumber) ? PREDLOCKTAG_TUPLE : \
430
418
(((locktag).locktag_field3 != InvalidBlockNumber) ? PREDLOCKTAG_PAGE : \
@@ -462,6 +450,7 @@ typedef struct TwoPhasePredicateXactRecord
462
450
typedef struct TwoPhasePredicateLockRecord
463
451
{
464
452
PREDICATELOCKTARGETTAG target ;
453
+ uint32 filler ; /* to avoid length change in back-patched fix */
465
454
} TwoPhasePredicateLockRecord ;
466
455
467
456
typedef struct TwoPhasePredicateRecord
0 commit comments