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 parentd6d7bba commitfe853caCopy full SHA for fe853ca
contrib/pg_dtm/libdtm.c
@@ -24,6 +24,10 @@ typedef struct DTMConnData
24
25
typedefunsigned long longxid_t;
26
27
+intDtmdPort;
28
+char*DtmdHost;
29
+
30
31
// Returns true if the write was successful.
32
staticbooldtm_write_char(DTMConndtm,charc)
33
{
@@ -237,7 +241,7 @@ static DTMConn GetConnection()
237
241
if (dtm==NULL)
238
242
239
243
// FIXME: add API for setting the host and port for dtm connection
240
-dtm=DtmConnect("127.0.0.1",5431);
244
+dtm=DtmConnect(DtmdHost,DtmdPort);
245
if (dtm==NULL) {
246
elog(ERROR,"Failed to connect to DTMD");
247
}
contrib/pg_dtm/libdtm.h
@@ -8,6 +8,9 @@
8
9
#defineINVALID_XID 0
10
11
+externintDtmdPort;
12
+externchar*DtmdHost;
13
14
voidDtmInitSnapshot(Snapshotsnapshot);
15
16
// Starts a new global transaction. Returns the
contrib/pg_dtm/pg_dtm.c
@@ -713,6 +713,33 @@ _PG_init(void)
713
NULL
714
);
715
716
+DefineCustomIntVariable(
717
+"dtm.dtmd_port",
718
+"DTMD port",
719
+NULL,
720
+&DtmdPort,
721
+5431,
722
+1,
723
+INT_MAX,
724
+PGC_BACKEND,
725
+0,
726
727
728
+NULL
729
+);
730
731
+DefineCustomStringVariable(
732
+"dtm.dtmd_host",
733
+"DTMD host name",
734
735
+&DtmdHost,
736
+"localhost",
737
738
739
740
741
+NULL);
742
743
/*
744
* Install hooks.
745
*/
src/backend/utils/time/tqual.c
@@ -1464,6 +1464,12 @@ HeapTupleIsSurelyDead(HeapTuple htup, TransactionId OldestXmin)
1464
returnTransactionIdPrecedes(HeapTupleHeaderGetRawXmax(tuple),OldestXmin);
1465
1466
1467
+bool
1468
+XidInMVCCSnapshot(TransactionIdxid,Snapshotsnapshot)
1469
+{
1470
+returnTM->IsInSnapshot(xid,snapshot);
1471
+}
1472
1473
1474
* XidInMVCCSnapshot
1475
*Is the given XID still-in-progress according to the snapshot?
@@ -1474,8 +1480,8 @@ HeapTupleIsSurelyDead(HeapTuple htup, TransactionId OldestXmin)
1480
* TransactionIdIsCurrentTransactionId first, except for known-committed
1481
* XIDs which could not be ours anyway.
1476
1482
1477
-staticbool
1478
-XidInMVCCSnapshot(TransactionIdxid,Snapshotsnapshot)
1483
1484
+PgXidInMVCCSnapshot(TransactionIdxid,Snapshotsnapshot)
1479
1485
1486
uint32i;
1487