@@ -3399,6 +3399,8 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
3399
3399
TransactionId update_xact ;
3400
3400
int remain ;
3401
3401
3402
+ * (int * )0 = 0 ;
3403
+
3402
3404
if (DoesMultiXactIdConflict ((MultiXactId ) xwait , infomask ,
3403
3405
* lockmode ))
3404
3406
{
@@ -3630,6 +3632,22 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
3630
3632
newtup -> t_data -> t_infomask2 |= infomask2_new_tuple ;
3631
3633
HeapTupleHeaderSetXmax (newtup -> t_data , xmax_new_tuple );
3632
3634
3635
+ {
3636
+ char buf [256 ];
3637
+ sprintf (buf , "backend-%d.trace" , getpid ());
3638
+ FILE * f = fopen (buf , "a" );
3639
+ Snapshot s = GetTransactionSnapshot ();
3640
+ fprintf (f , "xid=%d: old.ctid=[%x-%x,%x], old.xmin=%d, old.xmax=%d, old.mask=%x, new.xmin=%d, new.xmax=%d, new.flags=%x, snap.xmin=%d, snap.xmax=%d, xcnt=%d, xip={%d,%d,%d,%d,%d}\n" ,
3641
+ xid ,
3642
+ oldtup .t_data -> t_ctid .ip_blkid .bi_hi ,
3643
+ oldtup .t_data -> t_ctid .ip_blkid .bi_lo ,
3644
+ oldtup .t_data -> t_ctid .ip_posid ,
3645
+ HeapTupleHeaderGetRawXmin (oldtup .t_data ), HeapTupleHeaderGetRawXmax (oldtup .t_data ), oldtup .t_data -> t_infomask ,
3646
+ xid , xmax_new_tuple , infomask_new_tuple ,
3647
+ s -> xmin , s -> xmax , s -> xcnt , s -> xip [0 ], s -> xip [1 ], s -> xip [2 ], s -> xip [3 ], s -> xip [4 ]
3648
+ );
3649
+ fclose (f );
3650
+ }
3633
3651
Assert (xmax_new_tuple != xid || (newtup -> t_data -> t_infomask & HEAP_XMAX_LOCK_ONLY ) != 0 );
3634
3652
3635
3653
/*
0 commit comments