We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent7c03440 commit0335888Copy full SHA for 0335888
contrib/pg_xtm/dtmd/src/main.c
@@ -227,17 +227,17 @@ static void gen_snapshot(Transaction *t) {
227
228
staticxid_tget_global_xmin() {
229
inti,j;
230
-xid_txmin=MAX_XID;
+xid_txmin=INVALID_XID;
231
Transaction*t;
232
for (i=0;i<transactions_count;i++) {
233
t=transactions+i;
234
-j=t->snapshots_count>MAX_SNAPSHOTS_PER_TRANS ?MAX_SNAPSHOTS_PER_TRANS :t->snapshots_count;
235
-while (--j >=0) {
236
-Snapshot*s=transaction_snapshot(t,j);
237
-if(s->xmin<xmin) {
238
-xmin=s->xmin;
239
-}
240
-// minor TODO: Use 'times_sent' to generate a bit greater xmin?
+j=t->snapshots_count>MAX_SNAPSHOTS_PER_TRANS ?MAX_SNAPSHOTS_PER_TRANS :t->snapshots_count;
+while (--j >=0) {
+Snapshot*s=transaction_snapshot(t,j);
+if ((xmin==INVALID_XID)||(s->xmin<xmin)) {
+xmin=s->xmin;
+}
+// minor TODO: Use 'times_sent' to generate a bit greater xmin?
241
}
242
243
returnxmin;