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

Commitc111306

Browse files
XidEpoch++ if wraparound during checkpoint.
If wal_level = hot_standby we update the checkpoint nextxid,though in the case where a wraparound occurred half-way througha checkpoint we would neglect updating the epoch also. Updatingthe nextxid is arguably the wrong thing to do, but changing thatmay introduce subtle bugs into hot standby startup, while updatingthe value doesn't cause any known bugs yet. Minimal fix now toHEAD and backbranches, wider fix later in HEAD.Bug reported in #6291 by Daniel Farina and slightly differently inCause analysis and recommended fixes from Tom Lane and Andres Freund.Applied patch is minimal version of Andres Freund's work.
1 parent9f98704 commitc111306

File tree

1 file changed

+8
-1
lines changed
  • src/backend/access/transam

1 file changed

+8
-1
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7119,10 +7119,17 @@ CreateCheckPoint(int flags)
71197119
* If we are shutting down, or Startup process is completing crash
71207120
* recovery we don't need to write running xact data.
71217121
*
7122-
* Update checkPoint.nextXid since we have a later value
7122+
* Update checkPoint.nextXid since we may have a later value. If we
7123+
* do update the value, and we have wrapped, increment epoch also.
71237124
*/
71247125
if (!shutdown&&XLogStandbyInfoActive())
7126+
{
7127+
TransactionIdprevXid=checkPoint.nextXid;
7128+
71257129
LogStandbySnapshot(&checkPoint.nextXid);
7130+
if (checkPoint.nextXid<prevXid)
7131+
checkPoint.nextXidEpoch++;
7132+
}
71267133

71277134
START_CRIT_SECTION();
71287135

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp