summaryrefslogtreecommitdiff
path: root/src/include/replication
diff options
context:
space:
mode:
authorHeikki Linnakangas2024-03-18 09:35:08 +0000
committerHeikki Linnakangas2024-03-18 09:35:30 +0000
commitaafc05de1bf5c0324cb5e690c6742118c1ac4af6 (patch)
treec750628b17b1175e2ec4bb420275d3b6f2bced6b /src/include/replication
parentf1baed18bc3db50c72bfb00b6247b47689158445 (diff)
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
Diffstat (limited to 'src/include/replication')
-rw-r--r--src/include/replication/slotsync.h4
-rw-r--r--src/include/replication/walreceiver.h2
2 files changed, 2 insertions, 4 deletions
diff --git a/src/include/replication/slotsync.h b/src/include/replication/slotsync.h
index dca57c50204..61e154b31bf 100644
--- a/src/include/replication/slotsync.h
+++ b/src/include/replication/slotsync.h
@@ -26,9 +26,7 @@ extern PGDLLIMPORT char *PrimarySlotName;
extern char *CheckAndGetDbnameFromConninfo(void);
extern bool ValidateSlotSyncParams(int elevel);
-#ifdef EXEC_BACKEND
-extern void ReplSlotSyncWorkerMain(int argc, char *argv[]) pg_attribute_noreturn();
-#endif
+extern void ReplSlotSyncWorkerMain(char *startup_data, size_t startup_data_len) pg_attribute_noreturn();
extern int StartSlotSyncWorker(void);
extern void ShutDownSlotSync(void);
diff --git a/src/include/replication/walreceiver.h b/src/include/replication/walreceiver.h
index b906bb5ce83..12f71fa99b0 100644
--- a/src/include/replication/walreceiver.h
+++ b/src/include/replication/walreceiver.h
@@ -483,7 +483,7 @@ walrcv_clear_result(WalRcvExecResult *walres)
}
/* prototypes for functions in walreceiver.c */
-extern void WalReceiverMain(void) pg_attribute_noreturn();
+extern void WalReceiverMain(char *startup_data, size_t startup_data_len) pg_attribute_noreturn();
extern void ProcessWalRcvInterrupts(void);
extern void WalRcvForceReply(void);