@@ -74,9 +74,6 @@ static HTAB* xid2status;
74
74
static HTAB * gtid2xid ;
75
75
static DtmNodeState * local ;
76
76
static DtmTransState dtm_tx ;
77
- static timestamp_t firstReportTime ;
78
- static timestamp_t prevReportTime ;
79
- static timestamp_t totalSleepTime ;
80
77
static uint64 totalSleepInterrupts ;
81
78
static int DtmVacuumDelay ;
82
79
@@ -144,6 +141,9 @@ static cid_t dtm_sync(cid_t global_cid)
144
141
#if TRACE_SLEEP_TIME
145
142
{
146
143
timestamp_t now = dtm_get_current_time ();
144
+ static timestamp_t firstReportTime ;
145
+ static timestamp_t prevReportTime ;
146
+ static timestamp_t totalSleepTime ;
147
147
#endif
148
148
dtm_sleep (global_cid - local_cid );
149
149
#if TRACE_SLEEP_TIME
@@ -153,7 +153,7 @@ static cid_t dtm_sync(cid_t global_cid)
153
153
if (firstReportTime == 0 ) {
154
154
firstReportTime = now ;
155
155
} else {
156
- fprintf (stderr , "Sleep %lu of %lu usec (%f%%)\n" , totalSleepTime , now - firstReportTime , totalSleepTime * 100.0 /(now - firstReportTime ));
156
+ fprintf (stderr , "Sync sleep %lu of %lu usec (%f%%)\n" , totalSleepTime , now - firstReportTime , totalSleepTime * 100.0 /(now - firstReportTime ));
157
157
}
158
158
}
159
159
}
@@ -405,8 +405,9 @@ static TransactionId DtmAdjustOldestXid(TransactionId xid)
405
405
}
406
406
}
407
407
if (prev != NULL ) {
408
+ * (int * )0 = 0 ;
408
409
local -> trans_list_head = prev ;
409
- xid = prev -> xid ;
410
+ xid = prev -> xid ;
410
411
} else {
411
412
xid = FirstNormalTransactionId ;
412
413
}
@@ -454,6 +455,9 @@ bool DtmXidInMVCCSnapshot(TransactionId xid, Snapshot snapshot)
454
455
#if TRACE_SLEEP_TIME
455
456
{
456
457
timestamp_t now = dtm_get_current_time ();
458
+ static timestamp_t firstReportTime ;
459
+ static timestamp_t prevReportTime ;
460
+ static timestamp_t totalSleepTime ;
457
461
#endif
458
462
dtm_sleep (delay );
459
463
#if TRACE_SLEEP_TIME
@@ -463,7 +467,7 @@ bool DtmXidInMVCCSnapshot(TransactionId xid, Snapshot snapshot)
463
467
if (firstReportTime == 0 ) {
464
468
firstReportTime = now ;
465
469
} else {
466
- fprintf (stderr , "Sleep %lu of %lu usec (%f%%)\n" , totalSleepTime , now - firstReportTime , totalSleepTime * 100.0 /(now - firstReportTime ));
470
+ fprintf (stderr , "Snapshot sleep %lu of %lu usec (%f%%)\n" , totalSleepTime , now - firstReportTime , totalSleepTime * 100.0 /(now - firstReportTime ));
467
471
}
468
472
}
469
473
}
0 commit comments