Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfe853ca

Browse files
committed
Add DtmdHost and DtmdPort variables
1 parentd6d7bba commitfe853ca

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

‎contrib/pg_dtm/libdtm.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ typedef struct DTMConnData
2424

2525
typedefunsigned long longxid_t;
2626

27+
intDtmdPort;
28+
char*DtmdHost;
29+
30+
2731
// Returns true if the write was successful.
2832
staticbooldtm_write_char(DTMConndtm,charc)
2933
{
@@ -237,7 +241,7 @@ static DTMConn GetConnection()
237241
if (dtm==NULL)
238242
{
239243
// 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);
241245
if (dtm==NULL) {
242246
elog(ERROR,"Failed to connect to DTMD");
243247
}

‎contrib/pg_dtm/libdtm.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
#defineINVALID_XID 0
1010

11+
externintDtmdPort;
12+
externchar*DtmdHost;
13+
1114
voidDtmInitSnapshot(Snapshotsnapshot);
1215

1316
// Starts a new global transaction. Returns the

‎contrib/pg_dtm/pg_dtm.c‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,33 @@ _PG_init(void)
713713
NULL
714714
);
715715

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+
NULL,
727+
NULL,
728+
NULL
729+
);
730+
731+
DefineCustomStringVariable(
732+
"dtm.dtmd_host",
733+
"DTMD host name",
734+
NULL,
735+
&DtmdHost,
736+
"localhost",
737+
PGC_BACKEND,
738+
0,
739+
NULL,
740+
NULL,
741+
NULL);
742+
716743
/*
717744
* Install hooks.
718745
*/

‎src/backend/utils/time/tqual.c‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,12 @@ HeapTupleIsSurelyDead(HeapTuple htup, TransactionId OldestXmin)
14641464
returnTransactionIdPrecedes(HeapTupleHeaderGetRawXmax(tuple),OldestXmin);
14651465
}
14661466

1467+
bool
1468+
XidInMVCCSnapshot(TransactionIdxid,Snapshotsnapshot)
1469+
{
1470+
returnTM->IsInSnapshot(xid,snapshot);
1471+
}
1472+
14671473
/*
14681474
* XidInMVCCSnapshot
14691475
*Is the given XID still-in-progress according to the snapshot?
@@ -1474,8 +1480,8 @@ HeapTupleIsSurelyDead(HeapTuple htup, TransactionId OldestXmin)
14741480
* TransactionIdIsCurrentTransactionId first, except for known-committed
14751481
* XIDs which could not be ours anyway.
14761482
*/
1477-
staticbool
1478-
XidInMVCCSnapshot(TransactionIdxid,Snapshotsnapshot)
1483+
bool
1484+
PgXidInMVCCSnapshot(TransactionIdxid,Snapshotsnapshot)
14791485
{
14801486
uint32i;
14811487

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp