Skip to content

Commit 5fb4f7f

Browse files
committed
Add low bound parameter to DtmGlobalReserve
1 parent 34c5245 commit 5fb4f7f

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

contrib/pg_xtm/pg_dtm--1.0.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ AS 'MODULE_PATHNAME','dtm_begin_transaction'
66
LANGUAGE C;
77

88
CREATE FUNCTION dtm_join_transaction(xid integer) RETURNS void
9-
AS 'MODULE_PATHNAME','dtm_get_snapshot'
9+
AS 'MODULE_PATHNAME','dtm_join_transaction'
1010
LANGUAGE C;
1111

1212
CREATE FUNCTION dtm_get_current_snapshot_xmin() RETURNS integer

contrib/pg_xtm/pg_dtm.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,10 @@ static TransactionId DtmGetNextXid()
242242
} else {
243243
LWLockAcquire(dtm->xidLock, LW_EXCLUSIVE);
244244
if (dtm->nReservedXids == 0) {
245-
xid = DtmGlobalReserve(DtmLocalXidReserve);
245+
xid = DtmGlobalReserve(dtm->nextXid, DtmLocalXidReserve);
246246
dtm->nReservedXids = DtmLocalXidReserve;
247247
ShmemVariableCache->nextXid = xid;
248+
dtm->nextXid = xid;
248249
}
249250
Assert(dtm->nextXid == ShmemVariableCache->nextXid);
250251
xid = ShmemVariableCache->nextXid;
@@ -452,13 +453,6 @@ PG_FUNCTION_INFO_V1(dtm_get_current_snapshot_xmin);
452453
Datum
453454
dtm_get_current_snapshot_xmin(PG_FUNCTION_ARGS)
454455
{
455-
// if (IsolationUsesXactSnapshot()){ /* RR & S */
456-
// DtmEnsureConnection();
457-
// DtmGlobalGetSnapshot(DtmConn, DtmNodeId, gtid.xids[DtmNodeId], &DtmSnapshot);
458-
// Assert(CurrentTransactionSnapshot != NULL);
459-
// DtmMergeSnapshots(CurrentTransactionSnapshot, &DtmSnapshot);
460-
// DtmUpdateRecentXmin();
461-
// }
462456
PG_RETURN_INT32(CurrentTransactionSnapshot->xmin);
463457
}
464458

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy