diff options
author | Bruce Momjian <bruce@momjian.us> | 2011-04-25 12:00:21 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2011-04-25 12:00:21 -0400 |
commit | 76dd09bbec893c02376e3440a6a86a3b994d804c (patch) | |
tree | 721a384f3511d2dc72642afeea48629019a15bb3 /src/backend/postmaster/postmaster.c | |
parent | 02e6a115cc6149551527a45545fd1ef8d37e6aa0 (diff) |
Add postmaster/postgres undocumented -b option for binary upgrades.
This option turns off autovacuum, prevents non-super-user connections,
and enables oid setting hooks in the backend. The code continues to use
the old autoavacuum disable settings for servers with earlier catalog
versions.
This includes a catalog version bump to identify servers that support
the -b option.
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r-- | src/backend/postmaster/postmaster.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 6e7f66472fd..c0cf0336a1e 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -529,7 +529,7 @@ PostmasterMain(int argc, char *argv[]) * tcop/postgres.c (the option sets should not conflict) and with the * common help() function in main/main.c. */ - while ((opt = getopt(argc, argv, "A:B:c:D:d:EeFf:h:ijk:lN:nOo:Pp:r:S:sTt:W:-:")) != -1) + while ((opt = getopt(argc, argv, "A:B:bc:D:d:EeFf:h:ijk:lN:nOo:Pp:r:S:sTt:W:-:")) != -1) { switch (opt) { @@ -541,6 +541,11 @@ PostmasterMain(int argc, char *argv[]) SetConfigOption("shared_buffers", optarg, PGC_POSTMASTER, PGC_S_ARGV); break; + case 'b': + /* Undocumented flag used for binary upgrades */ + IsBinaryUpgrade = true; + break; + case 'D': userDoption = optarg; break; @@ -1480,8 +1485,13 @@ ServerLoop(void) if (WalWriterPID == 0 && pmState == PM_RUN) WalWriterPID = StartWalWriter(); - /* If we have lost the autovacuum launcher, try to start a new one */ - if (AutoVacPID == 0 && + /* + * If we have lost the autovacuum launcher, try to start a new one. + * We don't want autovacuum to run in binary upgrade mode because + * autovacuum might update relfrozenxid for empty tables before + * the physical files are put in place. + */ + if (!IsBinaryUpgrade && AutoVacPID == 0 && (AutoVacuumingActive() || start_autovac_launcher) && pmState == PM_RUN) { @@ -2413,7 +2423,7 @@ reaper(SIGNAL_ARGS) */ if (WalWriterPID == 0) WalWriterPID = StartWalWriter(); - if (AutoVacuumingActive() && AutoVacPID == 0) + if (!IsBinaryUpgrade && AutoVacuumingActive() && AutoVacPID == 0) AutoVacPID = StartAutoVacLauncher(); if (XLogArchivingActive() && PgArchPID == 0) PgArchPID = pgarch_start(); |