Skip to content

Commit d906905

Browse files
committed
cleanup 2
1 parent e9670e7 commit d906905

File tree

3 files changed

+1
-27
lines changed

3 files changed

+1
-27
lines changed

src/backend/access/transam/twophase.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,22 +219,18 @@ StandbyCheckPointTwoPhase(XLogRecPtr redo_horizon)
219219

220220
// Assert(RecoveryInProgress());
221221

222-
elog(WARNING, "StandbyCheckPointTwoPhase");
223-
224222
TRACE_POSTGRESQL_TWOPHASE_CHECKPOINT_START();
225223

226224
dlist_foreach_modify(miter, &StandbyTwoPhaseStateData)
227225
{
228226
StandbyPreparedTransaction *xact = dlist_container(StandbyPreparedTransaction,
229227
list_node, miter.cur);
230228

231-
if (redo_horizon == 0 || xact->prepare_end_lsn <= redo_horizon)
232-
// if (true)
229+
if (redo_horizon == InvalidXLogRecPtr || xact->prepare_end_lsn <= redo_horizon)
233230
{
234231
char *buf;
235232
int len;
236233

237-
fprintf(stderr, "2PC: checkpoint: %x --> %d (horizon: %x)\n", xact->prepare_start_lsn, xact->xid, redo_horizon);
238234
XlogReadTwoPhaseData(xact->prepare_start_lsn, &buf, &len);
239235
RecreateTwoPhaseFile(xact->xid, buf, len);
240236
pfree(buf);
@@ -270,8 +266,6 @@ StandbyAtCommit(TransactionId xid)
270266

271267
if (xact->xid == xid)
272268
{
273-
// pfree(xact);
274-
fprintf(stderr, "2PC: commit: %x/%d\n", xact->prepare_start_lsn, xact->xid);
275269
dlist_delete(miter.cur);
276270
return;
277271
}
@@ -1746,8 +1740,6 @@ StandbyAtPrepare(XLogReaderState *record)
17461740
xact->prepare_start_lsn = record->ReadRecPtr;
17471741
xact->prepare_end_lsn = record->EndRecPtr;
17481742

1749-
fprintf(stderr, "2PC: at_prepare: %x/%d\n", xact->prepare_start_lsn, xact->xid);
1750-
17511743
dlist_push_tail(&StandbyTwoPhaseStateData, &xact->list_node);
17521744
}
17531745

@@ -1789,7 +1781,6 @@ PrescanPreparedTransactions(TransactionId **xids_p, int *nxids_p)
17891781
int nxids = 0;
17901782
int allocsize = 0;
17911783

1792-
fprintf(stderr, "--- PrescanPreparedTransactions\n");
17931784
StandbyCheckPointTwoPhase(0);
17941785

17951786
cldir = AllocateDir(TWOPHASE_DIR);
@@ -1928,8 +1919,6 @@ StandbyRecoverPreparedTransactions(bool overwriteOK)
19281919
DIR *cldir;
19291920
struct dirent *clde;
19301921

1931-
fprintf(stderr, "--- StandbyRecoverPreparedTransactions\n");
1932-
19331922
cldir = AllocateDir(TWOPHASE_DIR);
19341923
while ((clde = ReadDir(cldir, TWOPHASE_DIR)) != NULL)
19351924
{
@@ -2013,8 +2002,6 @@ RecoverPreparedTransactions(void)
20132002
struct dirent *clde;
20142003
bool overwriteOK = false;
20152004

2016-
fprintf(stderr, "--- RecoverPreparedTransactions\n");
2017-
20182005
snprintf(dir, MAXPGPATH, "%s", TWOPHASE_DIR);
20192006

20202007
cldir = AllocateDir(dir);

src/backend/access/transam/xact.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5604,7 +5604,6 @@ xact_redo(XLogReaderState *record)
56045604
Assert(TransactionIdIsValid(parsed.twophase_xid));
56055605
xact_redo_commit(&parsed, parsed.twophase_xid,
56065606
record->EndRecPtr, XLogRecGetOrigin(record));
5607-
// RemoveTwoPhaseFile(parsed.twophase_xid, false);
56085607
StandbyAtCommit(parsed.twophase_xid);
56095608
}
56105609
}
@@ -5625,17 +5624,12 @@ xact_redo(XLogReaderState *record)
56255624
{
56265625
Assert(TransactionIdIsValid(parsed.twophase_xid));
56275626
xact_redo_abort(&parsed, parsed.twophase_xid);
5628-
// RemoveTwoPhaseFile(parsed.twophase_xid, false);
56295627
StandbyAtCommit(parsed.twophase_xid);
56305628
}
56315629
}
56325630
else if (info == XLOG_XACT_PREPARE)
56335631
{
56345632
/* the record contents are exactly the 2PC file */
5635-
// elog(WARNING, "2PC: RecreateTwoPhaseFile");
5636-
// RecreateTwoPhaseFile(XLogRecGetXid(record),
5637-
// XLogRecGetData(record), XLogRecGetDataLen(record));
5638-
elog(WARNING, "reading prepared tx");
56395633
StandbyAtPrepare(record);
56405634
}
56415635
else if (info == XLOG_XACT_ASSIGNMENT)

src/backend/access/transam/xlog.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6709,7 +6709,6 @@ StartupXLOG(void)
67096709

67106710
ProcArrayApplyRecoveryInfo(&running);
67116711

6712-
StandbyCheckPointTwoPhase(0);
67136712
StandbyRecoverPreparedTransactions(false);
67146713
}
67156714
}
@@ -8718,7 +8717,6 @@ CreateEndOfRecoveryRecord(void)
87188717
END_CRIT_SECTION();
87198718

87208719
LocalXLogInsertAllowed = -1; /* return to "check" state */
8721-
// StandbyCheckPointTwoPhase(0);
87228720
}
87238721

87248722
/*
@@ -8742,7 +8740,6 @@ CheckPointGuts(XLogRecPtr checkPointRedo, int flags)
87428740
CheckPointBuffers(flags); /* performs all required fsyncs */
87438741
CheckPointReplicationOrigin();
87448742
/* We deliberately delay 2PC checkpointing as long as possible */
8745-
StandbyCheckPointTwoPhase(checkPointRedo);
87468743
CheckPointTwoPhase(checkPointRedo);
87478744
}
87488745

@@ -9339,7 +9336,6 @@ xlog_redo(XLogReaderState *record)
93399336
Assert(info == XLOG_FPI || info == XLOG_FPI_FOR_HINT ||
93409337
!XLogRecHasAnyBlockRefs(record));
93419338

9342-
elog(WARNING, "2PC: xlog_redo, info=%x", info);
93439339
if (info == XLOG_NEXTOID)
93449340
{
93459341
Oid nextOid;
@@ -9423,8 +9419,6 @@ xlog_redo(XLogReaderState *record)
94239419

94249420
ProcArrayApplyRecoveryInfo(&running);
94259421

9426-
fprintf(stderr, "--- aaa\n");
9427-
StandbyCheckPointTwoPhase(0);
94289422
StandbyRecoverPreparedTransactions(true);
94299423
}
94309424

@@ -9517,7 +9511,6 @@ xlog_redo(XLogReaderState *record)
95179511
ereport(PANIC,
95189512
(errmsg("unexpected timeline ID %u (should be %u) in checkpoint record",
95199513
xlrec.ThisTimeLineID, ThisTimeLineID)));
9520-
// StandbyCheckPointTwoPhase(0);
95219514
}
95229515
else if (info == XLOG_NOOP)
95239516
{

0 commit comments

Comments
 (0)