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

Commit0335888

Browse files
committed
Fix global xmin calculation in DTM in case there are no active global transactions.
1 parent7c03440 commit0335888

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎contrib/pg_xtm/dtmd/src/main.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,17 +227,17 @@ static void gen_snapshot(Transaction *t) {
227227

228228
staticxid_tget_global_xmin() {
229229
inti,j;
230-
xid_txmin=MAX_XID;
230+
xid_txmin=INVALID_XID;
231231
Transaction*t;
232232
for (i=0;i<transactions_count;i++) {
233233
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?
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 ((xmin==INVALID_XID)||(s->xmin<xmin)) {
238+
xmin=s->xmin;
239+
}
240+
// minor TODO: Use 'times_sent' to generate a bit greater xmin?
241241
}
242242
}
243243
returnxmin;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp