Skip to content

Commit b040097

Browse files
committed
Reify code
1 parent 9f63dea commit b040097

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

contrib/pg_xtm/pg_dtm.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,21 @@ static Snapshot DtmGetSnapshot(Snapshot snapshot)
114114
{
115115
if (DtmHasSnapshot) {
116116
DtmCopySnapshot(snapshot, &DtmSnapshot);
117-
return snapshot;
117+
DtmUpdateRecentXmin();
118+
} else {
119+
snapshot = GetLocalSnapshotData(snapshot);
118120
}
119-
snapshot = GetLocalSnapshotData(snapshot);
120-
// DtmUpdateRecentXmin();
121121
return snapshot;
122122
}
123123

124-
124+
#if 0
125125
static bool IsInDtmSnapshot(TransactionId xid)
126126
{
127127
return DtmHasSnapshot
128128
&& (/*xid > DtmSnapshot.xmax
129129
|| */bsearch(&xid, DtmSnapshot.xip, DtmSnapshot.xcnt, sizeof(TransactionId), xidComparator) != NULL);
130130
}
131+
#endif
131132

132133
static bool DtmTransactionIsInProgress(TransactionId xid)
133134
{
@@ -254,11 +255,7 @@ dtm_get_snapshot(PG_FUNCTION_ARGS)
254255
DtmEnsureConnection();
255256
DtmGlobalGetSnapshot(DtmConn, DtmNodeId, GetCurrentTransactionId(), &DtmSnapshot);
256257

257-
// VacuumProcArray(&DtmSnapshot);
258-
259258
/* Move it to DtmGlobalGetSnapshot? */
260-
DtmUpdateRecentXmin();
261-
DtmSnapshot.curcid = GetCurrentCommandId(false);
262259
DtmHasSnapshot = true;
263260
PG_RETURN_VOID();
264261
}

contrib/pg_xtm/tests/transfers.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,7 @@ func execQuery(conn *pgx.Conn, stmt string, arguments ...interface{}) int32 {
221221

222222
func checkErr(err error) {
223223
if err != nil {
224-
//panic(err)
225-
fmt.Println(err)
224+
panic(err)
226225
}
227226
}
228227

0 commit comments

Comments
 (0)