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

Commit715f44b

Browse files
committed
Fix incomplete backpatch of pg_multixact truncation changes to <= 9.2
The backpatch ofa95335b to 9.2, 9.1and 9.0 was incomplete, missing changes to xlog.c, primarily the callto TrimMultiXact(). Testing presumably didn't show a problem withoutthese changes because TrimMultiXact() performs defense-in-depth work,which is not strictly necessary.It also missed moving StartupMultiXact() which would have beenproblematic if a restartpoing happened in exactly the wrong moment,causing a transient error.Andres Freund
1 parentff61dd2 commit715f44b

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6530,6 +6530,12 @@ StartupXLOG(void)
65306530
XLogCtl->ckptXidEpoch=checkPoint.nextXidEpoch;
65316531
XLogCtl->ckptXid=checkPoint.nextXid;
65326532

6533+
/*
6534+
* Startup MultiXact. We need to do this early because we need its state
6535+
* initialized because we attempt truncation during restartpoints.
6536+
*/
6537+
StartupMultiXact();
6538+
65336539
/*
65346540
* We must replay WAL entries using the same TimeLineID they were created
65356541
* under, so temporarily adopt the TLI indicated by the checkpoint (see
@@ -6696,8 +6702,9 @@ StartupXLOG(void)
66966702
ProcArrayInitRecovery(ShmemVariableCache->nextXid);
66976703

66986704
/*
6699-
* Startup commit log and subtrans only. Other SLRUs are not
6700-
* maintained during recovery and need not be started yet.
6705+
* Startup commit log and subtrans only. MultiXact has already
6706+
* been started up and other SLRUs are not maintained during
6707+
* recovery and need not be started yet.
67016708
*/
67026709
StartupCLOG();
67036710
StartupSUBTRANS(oldestActiveXID);
@@ -7238,7 +7245,7 @@ StartupXLOG(void)
72387245
/*
72397246
* Perform end of recovery actions for any SLRUs that need it.
72407247
*/
7241-
StartupMultiXact();
7248+
TrimMultiXact();
72427249
TrimCLOG();
72437250

72447251
/* Reload shared-memory state for prepared transactions */

‎src/include/access/multixact.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ extern Size MultiXactShmemSize(void);
5959
externvoidMultiXactShmemInit(void);
6060
externvoidBootStrapMultiXact(void);
6161
externvoidStartupMultiXact(void);
62+
externvoidTrimMultiXact(void);
6263
externvoidShutdownMultiXact(void);
6364
externvoidMultiXactGetCheckptMulti(boolis_shutdown,
6465
MultiXactId*nextMulti,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp