8000 testing lsn of xmin - 1 · pct960/postgres@d8bb422 · GitHub
[go: up one dir, main page]

Skip to content

Commit d8bb422

Browse files
committed
testing lsn of xmin - 1
1 parent 85969cd commit d8bb422

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/backend/access/transam/xact.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,8 +1286,8 @@ getMaxLSNFromSnapshot()
12861286
//}
12871287

12881288
//cur = GetActiveSnapshot();
1289-
cur = GetLatestSnapshot();
1290-
//cur = GetTransactionSnapshot();
1289+
//cur = GetLatestSnapshot();
1290+
cur = GetTransactionSnapshot();
12911291
if (cur == NULL)
12921292
elog(ERROR, "no active snapshot set");
12931293

@@ -1447,7 +1447,8 @@ RecordTransactionCommit(void)
14471447
//LWLockRelease(SyncRepLock);
14481448

14491449
XLogRecPtr remoteFlushLSN = ((volatile WalSndCtlData *) WalSndCtl)->lsn[Min(synchronous_commit, SYNC_REP_WAIT_APPLY)];
1450-
XLogRecPtr maxSnapshotLSN = getMaxLSNFromSnapshot();
1450+
//XLogRecPtr maxSnapshotLSN = getMaxLSNFromSnapshot();
1451+
XLogRecPtr maxSnapshotLSN = TransactionIdGetCommitLSN((MyProc->xmin) - 1);
14511452
//elog(INFO, "maxlsn = (%d), remotelsn = (%d)", XLogMaxLSN, remoteFlushLSN);
14521453

14531454
//if((XLogMaxLSN > remoteFlushLSN) && (remoteFlushLSN != 0))
@@ -2387,6 +2388,7 @@ CommitTransaction(void)
23872388
* must be done _before_ releasing locks we hold and _after_
23882389
* RecordTransactionCommit.
23892390
*/
2391+
23902392
ProcArrayEndTransaction(MyProc, latestXid);
23912393

23922394
TransactionId xid = GetTopTransactionIdIfAny();
@@ -2396,6 +2398,7 @@ CommitTransaction(void)
23962398
if (wrote_xlog && markXidCommitted)
23972399
SyncRepWaitForLSN(XactLastCommitEnd, true);
23982400

2401+
23992402
/*
24002403
* This is all post-commit cleanup. Note that if an error is raised here,
24012404
* it's too late to abort the transaction. This should be just

src/backend/storage/ipc/procarray.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,6 +2352,9 @@ GetSnapshotData(Snapshot snapshot)
23522352
if (NormalTransactionIdPrecedes(xid, xmin))
23532353
xmin = xid;
23542354

2355+
//if(allProcs[arrayP->pgprocnos[pgxactoff]].syncRepState == 1)
2356+
// continue;
2357+
23552358
/* Add XID to snapshot. */
23562359
xip[count++] = xid;
23572360

0 commit comments

Comments
 (0)
0