aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/multixact.h
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2013-11-29 11:26:41 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2013-11-29 21:47:15 -0300
commit1df0122daa6510eed4146033379a5055f66f5a8e (patch)
tree8784e3d301ca6cb27cf3dfc51e8285a4b1dde924 /src/include/access/multixact.h
parentf54106f77e6d71cbb3fa0924095e5142341fde2b (diff)
downloadpostgresql-1df0122daa6510eed4146033379a5055f66f5a8e.tar.gz
postgresql-1df0122daa6510eed4146033379a5055f66f5a8e.zip
Truncate pg_multixact/'s contents during crash recovery
Commit 9dc842f08 of 8.2 era prevented MultiXact truncation during crash recovery, because there was no guarantee that enough state had been setup, and because it wasn't deemed to be a good idea to remove data during crash recovery anyway. Since then, due to Hot-Standby, streaming replication and PITR, the amount of time a cluster can spend doing crash recovery has increased significantly, to the point that a cluster may even never come out of it. This has made not truncating the content of pg_multixact/ not defensible anymore. To fix, take care to setup enough state for multixact truncation before crash recovery starts (easy since checkpoints contain the required information), and move the current end-of-recovery actions to a new TrimMultiXact() function, analogous to TrimCLOG(). At some later point, this should probably done similarly to the way clog.c is doing it, which is to just WAL log truncations, but we can't do that for the back branches. Back-patch to 9.0. 8.4 also has the problem, but since there's no hot standby there, it's much less pressing. In 9.2 and earlier, this patch is simpler than in newer branches, because multixact access during recovery isn't required. Add appropriate checks to make sure that's not happening. Andres Freund
Diffstat (limited to 'src/include/access/multixact.h')
-rw-r--r--src/include/access/multixact.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/access/multixact.h b/src/include/access/multixact.h
index e6db81a8270..6085ea3ec16 100644
--- a/src/include/access/multixact.h
+++ b/src/include/access/multixact.h
@@ -98,6 +98,7 @@ extern Size MultiXactShmemSize(void);
extern void MultiXactShmemInit(void);
extern void BootStrapMultiXact(void);
extern void StartupMultiXact(void);
+extern void TrimMultiXact(void);
extern void ShutdownMultiXact(void);
extern void SetMultiXactIdLimit(MultiXactId oldest_datminmxid,
Oid oldest_datoid);