diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2013-12-02 13:28:18 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2013-12-02 13:28:18 -0300 |
commit | 0176f8bea436e166654fb3e5d2d8a1ff42552f7a (patch) | |
tree | 01480fcf01b1bc08c8acce66556505319c2422c6 /src/backend/access/transam/xlog.c | |
parent | 559eb85bff80f32a224975e0cad2f2f38e7c3435 (diff) | |
download | postgresql-0176f8bea436e166654fb3e5d2d8a1ff42552f7a.tar.gz postgresql-0176f8bea436e166654fb3e5d2d8a1ff42552f7a.zip |
Fix incomplete backpatch of pg_multixact truncation changes to <= 9.2
The backpatch of a95335b544d9c8377e9dc7a399d8e9a155895f82 to 9.2, 9.1
and 9.0 was incomplete, missing changes to xlog.c, primarily the call
to TrimMultiXact(). Testing presumably didn't show a problem without
these changes because TrimMultiXact() performs defense-in-depth work,
which is not strictly necessary.
It also missed moving StartupMultiXact() which would have been
problematic if a restartpoing happened in exactly the wrong moment,
causing a transient error.
Andres Freund
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 9ad3b3c962a..27de1ee5c84 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6309,6 +6309,12 @@ StartupXLOG(void) XLogCtl->ckptXid = checkPoint.nextXid; /* + * Startup MultiXact. We need to do this early because we need its state + * initialized because we attempt truncation during restartpoints. + */ + StartupMultiXact(); + + /* * We must replay WAL entries using the same TimeLineID they were created * under, so temporarily adopt the TLI indicated by the checkpoint (see * also xlog_redo()). @@ -6453,8 +6459,9 @@ StartupXLOG(void) ProcArrayInitRecovery(ShmemVariableCache->nextXid); /* - * Startup commit log and subtrans only. Other SLRUs are not - * maintained during recovery and need not be started yet. + * Startup commit log and subtrans only. MultiXact has already + * been started up and other SLRUs are not maintained during + * recovery and need not be started yet. */ StartupCLOG(); StartupSUBTRANS(oldestActiveXID); @@ -6966,7 +6973,7 @@ StartupXLOG(void) /* * Perform end of recovery actions for any SLRUs that need it. */ - StartupMultiXact(); + TrimMultiXact(); TrimCLOG(); /* Reload shared-memory state for prepared transactions */ |