mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
Refactor postmaster child process launching
Introduce new postmaster_child_launch() function that deals with the differences in EXEC_BACKEND mode. Refactor the mechanism of passing information from the parent to child process. Instead of using different command-line arguments when launching the child process in EXEC_BACKEND mode, pass a variable-length blob of startup data along with all the global variables. The contents of that blob depend on the kind of child process being launched. In !EXEC_BACKEND mode, we use the same blob, but it's simply inherited from the parent to child process. Reviewed-by: Tristan Partin, Andres Freund Discussion: https://www.postgresql.org/message-id/7a59b073-5b5b-151e-7ed3-8b01ff7ce9ef@iki.fi
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
#include "libpq/pqsignal.h"
|
||||
#include "miscadmin.h"
|
||||
#include "pgstat.h"
|
||||
#include "postmaster/auxprocess.h"
|
||||
#include "postmaster/interrupt.h"
|
||||
#include "postmaster/walwriter.h"
|
||||
#include "storage/bufmgr.h"
|
||||
@@ -85,13 +86,18 @@ int WalWriterFlushAfter = DEFAULT_WAL_WRITER_FLUSH_AFTER;
|
||||
* basic execution environment, but not enabled signals yet.
|
||||
*/
|
||||
void
|
||||
WalWriterMain(void)
|
||||
WalWriterMain(char *startup_data, size_t startup_data_len)
|
||||
{
|
||||
sigjmp_buf local_sigjmp_buf;
|
||||
MemoryContext walwriter_context;
|
||||
int left_till_hibernate;
|
||||
bool hibernating;
|
||||
|
||||
Assert(startup_data_len == 0);
|
||||
|
||||
MyBackendType = B_WAL_WRITER;
|
||||
AuxiliaryProcessMainCommon();
|
||||
|
||||
/*
|
||||
* Properly accept or ignore signals the postmaster might send us
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user