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

Commit0176f8b

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 parent559eb85 commit0176f8b

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
@@ -6308,6 +6308,12 @@ StartupXLOG(void)
63086308
XLogCtl->ckptXidEpoch=checkPoint.nextXidEpoch;
63096309
XLogCtl->ckptXid=checkPoint.nextXid;
63106310

6311+
/*
6312+
* Startup MultiXact. We need to do this early because we need its state
6313+
* initialized because we attempt truncation during restartpoints.
6314+
*/
6315+
StartupMultiXact();
6316+
63116317
/*
63126318
* We must replay WAL entries using the same TimeLineID they were created
63136319
* under, so temporarily adopt the TLI indicated by the checkpoint (see
@@ -6453,8 +6459,9 @@ StartupXLOG(void)
64536459
ProcArrayInitRecovery(ShmemVariableCache->nextXid);
64546460

64556461
/*
6456-
* Startup commit log and subtrans only. Other SLRUs are not
6457-
* maintained during recovery and need not be started yet.
6462+
* Startup commit log and subtrans only. MultiXact has already
6463+
* been started up and other SLRUs are not maintained during
6464+
* recovery and need not be started yet.
64586465
*/
64596466
StartupCLOG();
64606467
StartupSUBTRANS(oldestActiveXID);
@@ -6966,7 +6973,7 @@ StartupXLOG(void)
69666973
/*
69676974
* Perform end of recovery actions for any SLRUs that need it.
69686975
*/
6969-
StartupMultiXact();
6976+
TrimMultiXact();
69706977
TrimCLOG();
69716978

69726979
/* 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