@@ -57,7 +57,8 @@ static bool DtmGlobalTransaction = false;
57
57
static TransactionManager DtmTM = { DtmGetTransactionStatus , DtmSetTransactionStatus , DtmGetSnapshot , DtmTransactionIsInProgress };
58
58
static DTMConn DtmConn ;
59
59
60
- #define XTM_TRACE (fmt , ...) fprintf(stderr, fmt, ## __VA_ARGS__)
60
+ #define XTM_TRACE (fmt , ...)
61
+ //#define XTM_TRACE(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
61
62
#define XTM_CONNECT_ATTEMPTS 10
62
63
63
64
static void DtmEnsureConnection (void )
@@ -81,8 +82,8 @@ static void DumpSnapshot(Snapshot s, char *name)
81
82
char * cursor = buf ;
82
83
cursor += sprintf (
83
84
cursor ,
84
- "snapshot %s: xmin=%d, xmax=%d, active=[" ,
85
- name , s -> xmin , s -> xmax
85
+ "snapshot %s for transaction %d : xmin=%d, xmax=%d, active=[" ,
86
+ name , GetCurrentTransactionId (), s -> xmin , s -> xmax
86
87
);
87
88
for (i = 0 ; i < s -> xcnt ; i ++ ) {
88
89
if (i == 0 ) {
@@ -92,7 +93,7 @@ static void DumpSnapshot(Snapshot s, char *name)
92
93
}
93
94
}
94
95
cursor += sprintf (cursor , "]" );
95
- XTM_TRACE ("%s\n" , buf );
96
+ printf ("%s\n" , buf );
96
97
}
97
98
98
99
static void DtmCopySnapshot (Snapshot dst , Snapshot src )
@@ -101,7 +102,6 @@ static void DtmCopySnapshot(Snapshot dst, Snapshot src)
101
102
static TransactionId * buf ;
102
103
TransactionId prev = InvalidTransactionId ;
103
104
104
- XTM_TRACE ("XTM: DtmCopySnapshot for transaction%u\n" , GetCurrentTransactionId ());
105
105
DumpSnapshot (dst , "local" );
106
106
DumpSnapshot (src , "DTM" );
107
107
@@ -127,7 +127,7 @@ static void DtmCopySnapshot(Snapshot dst, Snapshot src)
127
127
}
128
128
}
129
129
dst -> xcnt = j ;
130
- DumpSnapshot (dst , "Merged " );
130
+ DumpSnapshot (dst , "merged " );
131
131
}
132
132
133
133
static void DtmUpdateRecentXmin (void )
@@ -157,7 +157,7 @@ static Snapshot DtmGetSnapshot(Snapshot snapshot)
157
157
snapshot = GetLocalSnapshotData (snapshot );
158
158
if (DtmHasSnapshot ) {
159
159
DtmCopySnapshot (snapshot , & DtmSnapshot );
160
- // DtmUpdateRecentXmin();
160
+ DtmUpdateRecentXmin ();
161
161
}
162
162
return snapshot ;
163
163
}
0 commit comments