diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 19be1a3995b..9086b79bc0c 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -5578,12 +5578,14 @@ compute_new_xmax_infomask(TransactionId xmax, uint16 old_infomask, new_infomask2; /* - * TODO Move this statement to callers? REPACK (CONCURRENTLY) uses - * add_to_xmax different from the current transaction when replaying data - * changes. Alternatively, we can add a boolean argument to the function - * indicating the special case, but that does not look nice. - */ - //Assert(TransactionIdIsCurrentTransactionId(add_to_xmax)); + * REPACK (CONCURRENTLY) replays data changes with the XID of the + * transaction that made them (TABLE_REUSE_XID), so add_to_xmax need not + * be ours. It only replays them on tuples of the new heap that nobody + * else can lock or modify and whose xmax it has not set, so xmax is + * still invalid here and our own transaction does not matter below. + */ + Assert(TransactionIdIsCurrentTransactionId(add_to_xmax) || + !TransactionIdIsValid(xmax)); l5: new_infomask = 0;