*** 83_rel/src/backend/bootstrap/bootstrap.c 2008-01-09 13:04:32.000000000 -0300 --- 23trunk/src/backend/bootstrap/bootstrap.c 2009-07-26 21:12:48.000000000 -0400 *************** *** 27,36 **** --- 27,39 ---- #include "catalog/index.h" #include "catalog/pg_type.h" #include "libpq/pqsignal.h" + #include "mammoth_r/mcp_queue.h" + #include "mammoth_r/txlog.h" #include "miscadmin.h" #include "nodes/makefuncs.h" #include "postmaster/bgwriter.h" #include "postmaster/walwriter.h" + #include "postmaster/replication.h" #include "storage/freespace.h" #include "storage/ipc.h" #include "storage/proc.h" *************** *** 48,54 **** #define ALLOC(t, c) ((t *) calloc((unsigned)(c), sizeof(t))) static void CheckerModeMain(void); ! static void BootstrapModeMain(void); static void bootstrap_signals(void); static void ShutdownAuxiliaryProcess(int code, Datum arg); static hashnode *AddStr(char *str, int strlength, int mderef); --- 51,57 ---- #define ALLOC(t, c) ((t *) calloc((unsigned)(c), sizeof(t))) static void CheckerModeMain(void); ! static void BootstrapModeMain(char *dbname); static void bootstrap_signals(void); static void ShutdownAuxiliaryProcess(int code, Datum arg); static hashnode *AddStr(char *str, int strlength, int mderef); *************** *** 207,212 **** --- 210,216 ---- int flag; AuxProcType auxType = CheckerProcess; char *userDoption = NULL; + char *dbname = NULL; /* * initialize globals *************** *** 313,319 **** } } ! if (argc != optind) { write_stderr("%s: invalid command-line arguments\n", progname); proc_exit(1); --- 317,325 ---- } } ! if (auxType == MammothBootstrapProcess && argc - optind + 1) ! dbname = argv[optind++]; ! else if (argc != optind || auxType == MammothBootstrapProcess) { write_stderr("%s: invalid command-line arguments\n", progname); proc_exit(1); *************** *** 337,342 **** --- 343,350 ---- case WalWriterProcess: statmsg = "wal writer process"; break; + case MammothBootstrapProcess: + statmsg = "mammoth bootstrap process"; default: statmsg = "??? process"; break; *************** *** 410,416 **** bootstrap_signals(); BootStrapXLOG(); StartupXLOG(); ! BootstrapModeMain(); proc_exit(1); /* should never return */ case StartupProcess: --- 418,432 ---- bootstrap_signals(); BootStrapXLOG(); StartupXLOG(); ! BootstrapModeMain(NULL); ! proc_exit(1); /* should never return */ ! ! case MammothBootstrapProcess: ! bootstrap_signals(); ! BootstrapTXLOG(); ! BootStrapMCPQueue(); ! StartupXLOG(); ! BootstrapModeMain(dbname); proc_exit(1); /* should never return */ case StartupProcess: *************** *** 469,487 **** * commands in a special bootstrap language. */ static void ! BootstrapModeMain(void) { int i; Assert(!IsUnderPostmaster); ! SetProcessingMode(BootstrapProcessing); /* * Do backend-like initialization for bootstrap mode */ InitProcess(); ! InitPostgres(NULL, InvalidOid, NULL, NULL); /* Initialize stuff for bootstrap-file processing */ for (i = 0; i < MAXATTR; i++) --- 485,506 ---- * commands in a special bootstrap language. */ static void ! BootstrapModeMain(char *dbname) { int i; Assert(!IsUnderPostmaster); ! if (dbname == NULL) ! SetProcessingMode(BootstrapProcessing); ! else ! SetProcessingMode(MammothBootstrapProcessing); /* * Do backend-like initialization for bootstrap mode */ InitProcess(); ! InitPostgres(dbname, InvalidOid, NULL, NULL); /* Initialize stuff for bootstrap-file processing */ for (i = 0; i < MAXATTR; i++) *** 83_rel/src/include/bootstrap/bootstrap.h 2008-01-09 13:04:49.000000000 -0300 --- 23trunk/src/include/bootstrap/bootstrap.h 2008-09-12 16:36:43.000000000 -0400 *************** *** 70,76 **** BootstrapProcess, StartupProcess, BgWriterProcess, ! WalWriterProcess } AuxProcType; #endif /* BOOTSTRAP_H */ --- 70,77 ---- BootstrapProcess, StartupProcess, BgWriterProcess, ! WalWriterProcess, ! MammothBootstrapProcess = 99 } AuxProcType; #endif /* BOOTSTRAP_H */